mirror of
https://github.com/DataTables/DataTables.git
synced 2024-11-29 11:24:10 +01:00
549bd19854
Being able to get and keep a reference to each row is quite important. You can't use the DataTables row index for this as it can potentially change, but we can use IDs, based on a unique value for each row in the data - `dt-init rowId`. I've made the decision to not require escaping of data in the ID. This means that selectors can be ID selectors with a cobontation of other things (#div.class for example) as that really doesn't make much sense in this contact - you only have rows that you can select from. Not requiring escaping makes both the client and library code much easier. This is documented. The implemention is to store a reference to each row's data object based on its id allowing for a trivial lookup. The object has its own index in the `aoData` array, so there is no `indexOf` required. The only downside is that the index must be updated when a row is deleted. This is done with a trivial for loop. |
||
---|---|---|
.. | ||
css | ||
images | ||
js | ||
unit_testing |