dependency between multiple kendo grids

4 posts, 0 answers
  1. littleGreenDude
    littleGreenDude avatar
    17 posts
    Member since:
    Jan 2014

    Posted 16 Apr 2014 Link to this post

    If I have multiple kendo grids on the same page each loaded by ajax in its own partial view.  How can I create a dependency between the 2 grids, so the 2nd grid won't load until the first grid has completed?
  2. Dimo
    Admin
    Dimo avatar
    8330 posts

    Posted 18 Apr 2014 Link to this post

    Hi Stephen,

    You can set autoBind:false to the desired (second) Grid and then call the fetch() method of its dataSource in the dataBound event of the first Grid.

    Regards,
    Dimo
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. littleGreenDude
    littleGreenDude avatar
    17 posts
    Member since:
    Jan 2014

    Posted 18 Apr 2014 in reply to Dimo Link to this post

    This doesn't seem to work.  Do I need any logic in the fetch?
    note - both grids call the same databound event.

    function onDataBound() {
        $("#Orders").find(".k-grid-toolbar").insertBefore($("#Orders .k-pager-wrap"));
        $("#ZeroBalanceOrders").find(".k-grid-toolbar").insertBefore($("#ZeroBalanceOrders .k-pager-wrap"));
     
        var grid = $("#ZeroBalanceOrders").data("kendoGrid");
        if (grid != null) {
            var count = grid.dataSource.total();
            if (count == 0) {
                $("#ZeroBalOrderList").hide();
            }
            else {
                $("#ZeroBalOrderList").show();
            }
        }
        else {
            grid.dataSource.fetch();
        }
    }
  4. littleGreenDude
    littleGreenDude avatar
    17 posts
    Member since:
    Jan 2014

    Posted 18 Apr 2014 in reply to littleGreenDude Link to this post

    Now that I read my post... I think I need to split it in to 2 different event handlers
Back to Top