jQWidgets Forums

jQuery UI Widgets Forums Grid Sending data to server side on each page change

This topic contains 1 reply, has 2 voices, and was last updated by  Dimitar 9 years, 1 month ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • Liji Joseph
    Participant

    hi,

    Iam trying to send the last row data when user clicks on next page. But the data sent is not changed after next page is selected.
    For example:

    I have my source :

    <script type=”text/javascript”>
    gridSource =
    {
    datatype: “json”,
    datafields: [
    { name: ‘CustomerName’, type: ‘string’ },
    { name: ‘rowkey’, type: ‘string’ }
    ],
    url: ‘/home/get’,
    data: { lastrowkey : $(“#hdnLastRowKey”).val()}
    };

    $(“#grid”).on(“pagechanged”, function (event) {
    $(“#hdnLastRowKey”).val(“nextRow”);
    });
    </script>

    <input type=”hidden” id=”hdnLastRowKey” value=”firstRow”/>

    I always get lastrowkey as “firstRow”, but i want the value to change on each page, in this case value should have been “nextRow”.

    What am i doing wrong?


    Dimitar
    Participant

    Hi Liji Joseph,

    You can try sending the data with an Ajax call, i.e.:

    $("#grid").on("pagechanged", function(event) {
        $("#hdnLastRowKey").val("nextRow");
    
        $.ajax({
            type: "POST",
            url: '/home/get',
            data: {
                lastrowkey: $("#hdnLastRowKey").val()
            }
        });
    });

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

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

You must be logged in to reply to this topic.