30.11.2014, 01:34
|
|
Профессор
|
|
Регистрация: 22.03.2012
Сообщений: 3,744
|
|
вот так наверное делать нужно, помещая код раскраски в callback-функцию
http://datatables.net/reference/option/ajax
Цитата:
|
function ajax( data, callback, settings )
Description:
As a function, making the Ajax call is left up to yourself allowing complete control of the Ajax request. Indeed, if desired, a method other than Ajax could be used to obtain the required data, such as Web storage or an AIR database.
When the data has been obtained from the data source, the second parameter (callback here) should be called with a single parameter passed in - the data to use to draw the table.
Simple example:
?
1
2
3
4
5
6
7
$('#example').dataTable( {
"ajax": function (data, callback, settings) {
callback(
JSON.parse( localStorage.getItem('dataTablesData') )
);
}
} );
|
|