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

Grid Not Displaying Properly After the First

3 Answers 104 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Randy
Top achievements
Rank 1
Randy asked on 13 Aug 2013, 05:11 PM
I am v2013.1.319

I have a kendo tab strip with 4 tabs, each has a separate grid. The first grid shows fine tab(0), the other three grids have their bottoms off the bottom of the tab. All of the grids are almost identical. I changed the first grid to the second position and the problem was the same the first grid was ok, the rest were off.

I added 
var ts = $("#tsCodesIndividual").data("kendoTabStrip");
and a
ts.select(0) before the first grid
ts.select(1) before the second grid and so on.

It now displays fine. A full example of a grid is below, the only real difference is the datasource:
    ts.select(1);
    tg.myServiceCodesViewModel = kendo.observable({ data: tg.myServiceCodes });
    delete tg.myServiceCodes;
    $("#codesIndividualServiceGrid").kendoGrid({
        dataSource: {
            data: tg.myServiceCodesViewModel.data,
            schema: {
                model: {
                    fields: {
                        custCode: { type: "string" },
                        tgCode: { type: "string" },
                    }
                }
            }
        },
        pageable: {
            pageSize: 10
        },
        height: 400,
        toolbar: ["create", "save"],
        columns: [
            { field: "custCode", title: "Code", width: "180px" },
            { field: "tgCode", title: "Service", width: "160px", values: tg.dlService },
            { command: "destroy", title: " ", width: "90px" }
        ],
        editable: true,
        resizable: true,
        reorderable: true,
        saveChanges: function (e) {
            if (!confirm("Are you sure you want to save all changes?")) {
                e.preventDefault();
            }
        },
    });

The tabstrip is extreamly basic:
    $("#tsCodesIndividual").kendoTabStrip({
        animation: {
            open: {
                effects: "fadeIn"
            }
        }
    });

3 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 15 Aug 2013, 11:57 AM
Hi Randy,

Current behavior is expected when the grid is initialized to an invisible tab - I would suggest to use for example the activate event of the tabStrip to initialize the grids in the initially invisible tabs. For example I created small jsBin demo which demonstrates loading of second grid on this event:


Kind Regards,
Vladimir Iliev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Randy
Top achievements
Rank 1
answered on 15 Aug 2013, 03:27 PM
Thanks for the clarification Vladimir.

I think I will stay with my existing solution. The tab strip itself in in a hidden div when the initialization of the tabs is done, so there is no flashing as it cycles through them. In my situation the likely hood of them opening it up and not using all 4 grids is low plus the weight of each grid is small, so the overhead/complexity of keeping track of which grid has been initialized is higher than what I am currently doing.

Thanks Again for the reply and alternative
Randy
0
Vladimir Iliev
Telerik team
answered on 16 Aug 2013, 06:47 AM
Hi Randy,

 
Another option is to first initialize the grids and then initialize the tabStrip:


Kind Regards,
Vladimir Iliev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Randy
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Randy
Top achievements
Rank 1
Share this question
or