jQuery UI Widgets › Forums › Grid › query string length limit in update
This topic contains 6 replies, has 2 voices, and was last updated by piponzio 9 years, 5 months ago.
-
Author
-
Hi,
my row grid gets updated with this code:
updaterow: function (rowid, rowdata, commit) { var data = “update=true&” + $.param(rowdata);
etc…But $.param(rowdata) is a very long string, more than 500 characters.
Is there any string limit? If so, is there a different method to update successfully?
Hi piponzio,
You can use POST instead of GET in your AJAX calls so you don’t have to worry about that.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comThanks Peter, but is there any parameter configuration for gridview which use POST method also for sorting, filtering etc…?
I suspect that the default configuration for these operations uses GET method, that’s why I notice a strange behaviour when executing POST ajax calls with datagrid in filtering mode (for example 2 rows are added when addrow function is executed and gridview has filtered columns; it doesn’t happen if there are no filtered columns).
The problem happens also if I use ‘type: POST’ for my gridview jqx.dataAdapter.
My code is:
var mygridsource = { ..... datatype: "json", type: "POST", addrow: function (rowid, rowdata, position, commit) { rowdata['insert'] = true; $.ajax( { dataType: 'json', type: 'POST', url: 'myurl.php', //insert and retrieve last inserted id data: rowdata, success: function (data, status, xhr) { commit(true, data); }, error: function () { commit(false); } }); } }; $("#addRow").click(function() { $("#jqxgrid").jqxGrid("addrow", null, {}, "first"); //insert a row at first position with row id retrieved from insert operation });
Hello Peter, I think the problem is not related to my specific scenario: it seems that adding a row when a server side multi page grid is filtered by a column, results in adding/visualizing 2 new rows instead of 1.
Hi piponzio,
You’re something wrong here. The Grid does not and cannot add 2 rows when addrow is called one time. If it adds 2 rows, then you most probably bind to your click event more than 1 time. The Grid is also Client Side widget. It does not matter whether its POST or GET in your AJAX calls because they are not related to jqxGrid.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi Peter, the problem was due to this configuration in jqxgrid:
sortable: true,
showfilterrow: true,
filterable: true,
columnsresize: true,
editable: true,
selectionmode: ‘singlerow’,
editmode: ‘selectedrow’, // it causes the problem
pageable: true,
pagermode: ‘simple’,
virtualmode: truewhich must be:
sortable: true,
showfilterrow: true,
filterable: true,
columnsresize: true,
editable: true,
selectionmode: ‘singlerow’,
editmode: ‘dblclick’, // it works
pageable: true,
pagermode: ‘simple’,
virtualmode: trueI don’t know why, but now it works.
-
AuthorPosts
You must be logged in to reply to this topic.