jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Problem with editting cells
Tagged: cellbeginedit, cellendedit, cells, edit, grid, jqxgrid, mysql, setcellvalue, setcellvaluebyid
This topic contains 1 reply, has 2 voices, and was last updated by Dimitar 11 years ago.
Viewing 2 posts - 1 through 2 (of 2 total)
-
Author
-
Hi,
this is my code…
$(document).ready(function () { // prepare the data var source = { updaterow: function (rowid, rowdata, commit) { // synchronize with the server - send update command // call commit with parameter true if the synchronization with the server is successful // and with parameter false if the synchronization failder. commit(true); }, datatype: "json", datafields: [ { name: 'taaknummer', type: 'string'}, { name: 'naam', type: 'string'}, { name: 'taak', type: 'string'}, { name: 'prioriteit', type: 'string'}, { name: 'datum', type: 'string'} ], url: 'http://www.gamepedia.nl/management/takenlijstdata.php', cache: false }; var dataAdapter = new $.jqx.dataAdapter(source); $("#jqxgrid").jqxGrid( { source: dataAdapter, pagesize : 50, pagesizeoptions: ['50', '100', '200'], width : 1280, theme:"energyblue", showfilterrow: true, source: dataAdapter, filterable: true, pageable: true, editable: true, enabletooltips: true, autoheight: true, filtermode: 'excel', selectionmode: 'multiplecellsadvanced', columns: [ { text: 'Taaknummer', datafield: 'taaknummer', width: 100}, { text: 'Naam', datafield: 'naam', width: 150 }, { text: 'Taak', datafield: 'taak', width: 680 }, { text: 'Prioriteit', datafield: 'prioriteit', width: 200 }, { text: 'Datum', datafield: 'datum', width: 120 } ] }); $('#clearfilteringbutton').jqxButton({ height: 25}); $('#clearfilteringbutton').click(function () { $("#jqxgrid").jqxGrid('clearfilters'); }); $("#jqxgrid").on('cellbeginedit', function (event) { var args = event.args; $("#cellbegineditevent").text("Event Type: cellbeginedit, Column: " + args.datafield + ", Row: " + (1 + args.rowindex) + ", Value: " + args.value); }); $("#jqxgrid").on('cellendedit', function (event) { var args = event.args; $("#cellendeditevent").text("Event Type: cellendedit, Column: " + args.datafield + ", Row: " + (1 + args.rowindex) + ", Value: " + args.value); }); });
for some reason it does not update the cell. Can you tell me why? I think because i call the data from another php file with some sql code….
Hello kbloem,
There is not code for updating cells here – you just initialize a grid and bind to the cellbeginedit and cellendedit events. Cells can be updated with the setcellvalue and setcellvaluebyid methods.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.