ajax - Jquery Datatables Fully Modifiable Data Table -
I am currently trying to create a fully modified data table with Jquery's Datatable plugin. With a completely revised table, I mean that a user will be able to edit, remove, update columns in the table. Based on the examples, I am currently trying the following javascript code:
function var_dump {ifj (object type obj == "object") {return "type: "+ Obj.constructor?" \ N Constructor: "+ obj.constructor:" "+) \" value: "+ obj; } Other {Return "Type:" + Type (OBJ) + "\ n Value:" + OB; }} // And Function var_dump var oTable; Var giRedraw = false; Var giCount = 11; $ (Document) .ready (function () add a click handler to the rows - it can be used as a callback * / $ ("# example tbody") Click (function (event) {$ (OTable. FnSettings (.aoData) .each (function () {$ (this.nTr) .removeClass ('row_selected');}); $ (event.target.parentNode) .addClass ('row_selected');} ) / * Add a click handler for the deleted line * / $ ('# delete'). (Function () {var selected one = FNGet selected (optible); var iRow = oTable.fnGetPosition (select one Gone [0]); oTable.fnDeleteRow "Lib / server_processing.php", "fnDrawCallback": f Datable ({"bProcessing": true, "bServerSide": true, "sAjaxSource" {$ ('# instance TD'), as in the form of a function (), ITable = $ ('# example'). Lib / editable_ajax.php ', {"callback": function (sValue, y) {alert (sValue)) / * Retrieve table from new data on server * / oTable.fnDraw ();}, "height": " 14px "});}}};}); Function fnClickAddRow () {oTable.fnAddData ([giCount + "1", giCount + "2.", giCount + "3", giCount + "4", giCount + ".5", "]); GiCount ++; } / * Find the rows that are currently selected * / function fnGetSelected (oTableLocal) {var aReturn = new Array (); Var aTrs = oTableLocal.fnGetNodes (); (Var i = 0; i & lt; aTrs.length; i ++) {if ($ (ATRs [i]). Haclus ('line_schedited')) {aReturn.push (ATRs [i]); }} Return return; }
This works fine in the user interface, but I do not have any information about sending column information to the server. I'm okay, I can send a new value of the column to server_ajax script But how can I send other relevant information about the columns like the unique ID of the edited columns in the database?
If you want to use DataTables here, the article about how JQuery DataTables With all the necessary procedures to implement CRYud functionality, the jquery.datatables.editable.js plugin, which adds CRUID functionality to the top of the Datatables Plugin
Comments
Post a Comment