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

Two Problems with Kendo Grid

2 Answers 174 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marcin
Top achievements
Rank 1
Veteran
Marcin asked on 30 Mar 2014, 01:49 PM
Hello. I have 2 separate problems with Kendo Grid:

I've created test case to demonstrate them (it is SPA application): Open index.html

1. First can be reproduced by clicking Test 1 and Test 2 ( initially test 1 part is loaded).
a) after load Test 1 - Grid is shown without issue:
b) after press Test 2 - Second Grid is loaded without issue.
c)
after pressing Test 1 - First grid should be now shown but there is an
issue, and following error can be seen in e.g. Firebug console:
  Cannot call method 'value' of kendoDropDownList before it is initialized

This error is related to pageSizes flag. When it is false, there is no problem, but when it set to true or to size Array, error above occurring.

2.
Second problem is related to new column locking functionality. My
scenario requires to hide grid sometimes. Steps to reproduce:
a) press Read - after finishing loading grid will be hidden
b) press Read again - after finishing loading grid will be shown, but wrongly with columns wrongly displaying.

Kind Regards
Marcin

2 Answers, 1 is accepted

Sort by
0
Marcin
Top achievements
Rank 1
Veteran
answered on 30 Mar 2014, 01:51 PM
Sorry, for multiple posts, but I didn't see my previosu posts, and adding new post shown me an Error. Please remove my post duplications.
0
Accepted
Petur Subev
Telerik team
answered on 02 Apr 2014, 08:27 AM
Hello Marcin,

The problem happens because the widgets are not destroyed but re-created each time you switch between the views. To make it work properly you should clean-up with the destroy method before navigating.

e.g.

$.sammy(contentSelector, function() {
    this.get(/\#\/(.*)/, function(context) {       
        var url = getUrlFromHash(context.path);
        kendo.destroy($("body"));
        context.load(url).swap();
 
    });
}).run('#/test1');



The second problem occurs because the Grid re-creates its layout when it is invisible - you should first make the Grid visible and then you should refresh/dataSource.read it. Other-way it is not able to re-calculate the space that it have to use properly.

http://trykendoui.telerik.com/@pesho/aFOG

Kind Regards,
Petur Subev
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
Marcin
Top achievements
Rank 1
Veteran
Answers by
Marcin
Top achievements
Rank 1
Veteran
Petur Subev
Telerik team
Share this question
or