Folks,
This is probably a more general jQuery question, something I am still learning. But I want to abstract my datatable creation a bit. So I created a separate js function, to which I pass my data, css name, etc. It creates the table, then I want to pass back that table. Reason for that, is so that I can perform work against it later (like filter calls, etc). However I just cannot with JS get it done, any experts?
So far its something like
However oTable is always undefined. Is there a way to perform a callback?
This is probably a more general jQuery question, something I am still learning. But I want to abstract my datatable creation a bit. So I created a separate js function, to which I pass my data, css name, etc. It creates the table, then I want to pass back that table. Reason for that, is so that I can perform work against it later (like filter calls, etc). However I just cannot with JS get it done, any experts?
So far its something like
function createTable(data, columns, css) { var oTable; $function() { var tablecss = $(css); oTable = tableCss.dataTable( { // datatable stuff }); } return oTable; }
However oTable is always undefined. Is there a way to perform a callback?