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.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • query string length limit in update #75352

    piponzio
    Participant

    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?

    query string length limit in update #75355

    Peter Stoev
    Keymaster

    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 Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    query string length limit in update #75365

    piponzio
    Participant

    Thanks 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).

    query string length limit in update #75367

    piponzio
    Participant

    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
                });
    query string length limit in update #75404

    piponzio
    Participant

    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.

    query string length limit in update #75408

    Peter Stoev
    Keymaster

    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 Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    query string length limit in update #75411

    piponzio
    Participant

    Hi 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: true

    which must be:

    sortable: true,
    showfilterrow: true,
    filterable: true,
    columnsresize: true,
    editable: true,
    selectionmode: ‘singlerow’,
    editmode: ‘dblclick’, // it works
    pageable: true,
    pagermode: ‘simple’,
    virtualmode: true

    I don’t know why, but now it works.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.