Click here to Skip to main content
14,698,687 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
the paging/sorting in my custom kengo-grid-plugin on the pop-up is not working properly. It just stays on the same page when page no-2,3,4.. is clicked. The webpage has a button on the click of which It brings the grid data dynamially on pop-up based on some search criteria.

here is the generic pluggin :-

// A generic kendo grid which is highly configurable

(function ($) {
    
    $.fn.genericPlugin = function (configuration) {
      //  var cachedConfi = configuration;
        $(this).kendoGrid({
            editable: configuration.editable,
            pageable: configuration.pageable,
            sortable: configuration.sortable,
            groupable: configuration.groupable,
            pageSize: configuration.pageSize,
            autobind:configuration.autobind,
            autoSync: configuration.autoSync,
            selectable: configuration.selectable,
            serverPaging: configuration.serverPaging,
            serverSorting:configuration.serverSorting,
            dataSource:  configuration.dataSource, 
            columns: configuration.columns,
            navigatable: configuration.navigatable,
            schema: configuration.schema
        });
    }
}(jQuery));


and here is how i am calling this pluggin :-

 var grid = $("#PopUpGrid").data("kendoGrid");
$("#PopUpGrid").genericPlugin(grid.dataSource.read());



and following is the pop-up in which we have added the generic grid. This is only for demo purpose and should be commented after that.

$(document).ready(function () {
    var win = $("#window").kendoWindow({
        actions: ["Custom", "Pin", "Refresh", "Maximize", "Minimize", "Close"],
        height: "500px",
        title: "Contact List",
        visible: false,
        position: {
                    top: 100,
                    left: 100
        },
        resizable: true,
        pageable: true,
        sortable:true,
        width: "1200px"
    }).data("kendoWindow").refresh();
});

$("#openButton").click(function () {
    var win = $("#window").data("kendoWindow").refresh();
    win.center();
    win.open();

    //      var grid = window.parent.$("#PopUpGrid").data("kendoGrid");
       var grid = $("#PopUpGrid").data("kendoGrid");

    if (ValidateSearchText()) {
        $scope.ShowSearchTextMissing = false;
        TurnOnProgress();

      //  $("#PopUpGrid").genericPlugin($scope.gridOptions.datasource.read());
       $("#PopUpGrid").genericPlugin(grid.dataSource.read());
    }
    });
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900