jQWidgets Forums

jQuery UI Widgets Forums Grid Need to prevent to go to next/previous page

Tagged: , , ,

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

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Hi Peter,
    I have one scenario like when i will click to next button in grid(paging) it will check if the records in the grid has been updated or edited then it will show an alert(Please save the changes.) and prevent to go to the next page/previous page. How will i do.Not getting any property /method which will prevent to go to next page. Below i have given example but i know we should not use pagechanged event.How will i handle please help.

    $(“#Injqxgrid”).bind(“pagechanged”, function (event) {
    //dataTobeSaved is an array when the records will be edited that row data will be added to dataTobeSaved array variable.
    debugger;
    if (dataTobeSaved.length > 0) {
    alert(“Please save the changes.”);
    //$(‘#Injqxgrid’).jqxGrid({ pageable: false });
    }
    else if (dataTobeSaved.length == 0) {
    var args = event.args;
    var pagenumber = args.pagenum;
    var pagesize = args.pagesize;
    var pageno = pagenumber + 1;

    RecordSizeInGrid = pageno * pagesize + 1;
    //Below function will call the db and show the records.
    LoadInternalGrid($(‘#ddlRequestStatus’).val(), RecordSizeInGrid);
    }
    //}
    });

    Thanks,
    Rajani


    Dimitar
    Participant

    Hello RajaniKantaPanda,

    The solution is to use custom-built pager, as shown in the example Custom Pager. There you may implement a function to be called before the grid goes to the next or previous page.

    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.