This is a migrated thread and some comments may be shown as answers.

dependency between multiple kendo grids

3 Answers 59 Views
Let's talk about telerik (the good and the bad)
This is a migrated thread and some comments may be shown as answers.
littleGreenDude
Top achievements
Rank 1
littleGreenDude asked on 16 Apr 2014, 07:43 PM
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?

3 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 18 Apr 2014, 02:11 PM
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!
 
0
littleGreenDude
Top achievements
Rank 1
answered on 18 Apr 2014, 03:20 PM
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();
    }
}
0
littleGreenDude
Top achievements
Rank 1
answered on 18 Apr 2014, 03:25 PM
Now that I read my post... I think I need to split it in to 2 different event handlers
Tags
Let's talk about telerik (the good and the bad)
Asked by
littleGreenDude
Top achievements
Rank 1
Answers by
Dimo
Telerik team
littleGreenDude
Top achievements
Rank 1
Share this question
or