Monday 15 September 2014

Accessing hidden columns of jquery datatables when pagination is on -


My statistics load data in about 5 pages, I'm able to access the hidden columns in the first page. But when I click the rows in the next pages, the click event is not being caught. DataTable ("full_numbers", "bJQueryUI"): True, this is my code:

  $ (document) .ready (function () {$ ("# dataobjects ")" AoColumns ": [/ * Client * / tap, / * check * / tap, / * disks * / tap, / * system usage (%) * / null, / * valid * / null, / * result * / $ ("# Dataobjects '). DataTab (); $ (" # "), /' timestamp / null, / * facts * / {" bSearchable ": wrong," bvisible ": false},]}) ; OTable = $ (Click '# dataobjects' (function (e) {if ($ (this) .hasClass ('row_selected')) {$ (this) .removeClass ('row_selected');} and {oTable. $ ('Tr. (' Row_selected '). RemoveClass (' row_selected '); $ (this) .addClass (' row_selected '); // data from selected row ("Output:" + Fid);}});    

Tr elements are not present unless you have access to the next page, try using the event delegation on the table element:

  $ ("# Dataobjects"). ('Click', 'toddy tr', function (e) {if ($ (this) .hasClass ('row_selected')) {$ (this) .removeClass ('row_selected');} Else {oTable. $ ('Tr.row_selected'). RemoveClass ('row_selected'); $ (This) .addClass ('row_selected'); // Receive data from the selected row var var fid = oTable.fnGetData (this, 7); Warning ( "Output:" + Fid);}});    

No comments:

Post a Comment