Hi oli
$("#example-table").tabulator("getRow", 1); - Find Error - No matching row found: 1
$("#example-table").tabulator("deleteRow", 1); - Delete Error - No matching row found: 1
while addRow and setData works
what seems to be the issue ?
You need to make sure that you have a column in your table containing unique values that correspond to the index of the row you are trying to get or delete. By default, tabulator will use the column with field: "id" as the index value however you can change this default behaviour when initializing tabulator e.g.
$("#example-table").tabulator({
index:"age", //set the index field to the "age" field.
});
If you don't want your index column to be visible e.g. if it just contains unique id numbers for each row then simply set visible: false in your column definition for this column.
If you are still struggling please post a copy of your table construct.
you are right @tomheaps its due to the index not set. Working now
Aren't name "index" supposed to be the row index from 1,2,3, etc..
I feel like its misleading.
A unique value is required for the index because otherwise the index number of the row would change every time the table was manipulated e.g. by sorting or filtering.
Hey @mohanen,
@tomheaps is bang on there. the index is a uniquely identifiable value for a row that does not change, because you can sort the data in Tabulator, basing the index on this would result in a value that changes.
In one of the upcomming releases i will be adding a lookup based on the position of the row in the table as well.
Cheers
Oli
Most helpful comment
You need to make sure that you have a column in your table containing unique values that correspond to the index of the row you are trying to get or delete. By default, tabulator will use the column with field: "id" as the index value however you can change this default behaviour when initializing tabulator e.g.
If you don't want your index column to be visible e.g. if it just contains unique id numbers for each row then simply set
visible: falsein your column definition for this column.If you are still struggling please post a copy of your table construct.