I am working in Datatable and fund that its one of the greatest plugins I have ever seen in my life.
I am making a table in JSP as :
I used live update plugin that pushes the data from the server peiodically:
Now I used plugin as
Now what happens fnRender calls from starting and adds the link and button simultaneously but I want that the link will be when I click on some button.
I am making a table in JSP as :
<table id='table' align='center' width='100%'> <thead> <tr> <th>Name</th> <th>Age</th> <th>Send To</th> </tr> </thead> <tbody> <% for(blah blah){ %> <tr> <td><%=name%></td><!--name is server side variable--> <td><%=age%></td><!--age is server side variable--> <td><button><%=urltocall%></button></td><!--urltocall is server side variable--> </tr> <%} %> </tbody> </table>
I used live update plugin that pushes the data from the server peiodically:
Now I used plugin as
var table = $('#table'); table.dataTable({ "bJQueryUI" : true, "sDom" : 'R<"H"lfr>t<"F"ip>', "aoColumns": [ null, null, { // third column (Edit link) "sName": "SendTo", "bSearchable": false, "bSortable": false, "bUseRendered" :false, "fnRender": function (oObj){ return "<button>Click " + oObj.aData[2] + "</button>"; } } ] }); var dt = table.dataTable(); //and for adding additional field I do like this dt.dataTable().fnAddData([ "<name >" , //name is js variable "<Age>",//age is js variable i++ ]);
Now what happens fnRender calls from starting and adds the link and button simultaneously but I want that the link will be when I click on some button.