Using jquery datatable jeditable without a required URL field

How can you use the jquery.datatable and jeditable without a url. I just want to edit the functionality without saving to the server. This is what I tried:

 $('td', oTable.fnGetNodes()).editable(function(value, settings) { console.log(this); console.log(value); console.log(settings); return(value);}, { type : 'textarea', submit : 'OK', callback: function( sValue, y ) { var aPos = oTable.fnGetPosition( this ); oTable.fnUpdate( sValue, aPos[0], aPos[1] ); }, }); 
+4
source share
1 answer

I took the Jeditable (or jEditable) example on datatables.net and modified it based on what Golden Bird provided in the question and what the Jeditable docs say about this. To check, you can edit any value in the grid, sorting is applied at the same time, and everything else is connected with working with data (for example, to search for a new value).


 $(document).ready(function() { var oTable = $('table').dataTable(); var theCallback = function(v, s) { // Do something with the new value return v; }; $(oTable).find('td').editable(theCallback, { "callback": function(sValue, y) { var aPos = oTable.fnGetPosition(this); oTable.fnUpdate(sValue, aPos[0], aPos[1]); }, "data": "{'0':'0%', '.1':'10%', '.15': '15%', '.2': '20%', 'selected':'0'}", "type" : "select", "submit" : "OK", "style": {"height": "100%","width": "100%"} }); }); 
+8
source

All Articles