asp.net - Objects in jquery DataTable only work for the first page -
i building web app using asp.net , using jquery datatable plugin create tables information retrieve database. populate tables fine correct information problem object such submit buttons won't behave correctly after page 1. happens 1 of aspx pages using while works fine in other one. though pretty exact same thing except 1 less column , of course content within each cell of table.
i know there solutions such using live() , binding buttons how labels , other objects? more clear, when try style labels table applies first page it's datatables doesn't recognize other elements apart page 1.
so after couple of hours of trying find ways around binding each element .live or .on event found solution, styling , modifications elements before initialize datatable.
in case, let's take objective style label on condition it's value either equals 'connected' or 'not connected' after querying database.
before this....
var otable = $('#tblwebsites').datatable({ "aocolumndefs": [ { "bsortable": false, "atargets": [0] } ], 'spaginationtype': 'full_numbers', "aasorting": [[1, 'asc']], "idisplaylength": 2,.......});
i call function check each of labels , style them using conditional. works perfectly! works other elements might require user manipulation such textareas.
hope solution helps similar future situations!
Comments
Post a Comment