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

[Solved] grid.setDataSource bug in Kendo UI upgrade

13 Answers 448 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bradley
Top achievements
Rank 1
Bradley asked on 28 Aug 2014, 03:19 PM
Using upgraded kendo.all.min.js, grid.setdataSource() does not remove unlocked columns (see image on attached file), and script hangs up without completing processing this line of code.

Locking all columns does not result in function running successfully.

Commenting out the next to last line of grid.setDataSource():  t.selectable && t._selectable(), solves the problem and setDataSource() works as expected, except that grid rows are no longer selectable.

I created a method with setDataSource code, commented out the problem line, and now call it for our grid refresh and save routines, which call setDataSource.

This is method I call in lieu of calling grid.setDataSource():

   // source code for grid.setDataSource() with problem line commented out
    var setDataSource = function (e) {
        var grid = $('#mainGrid').data("kendoGrid");
        var t = grid;
        
        t.options.dataSource = e,
        t._dataSource(),

        t._pageable(),
        t._thead(),
        t.options.groupable && t._groupable(),
        t.virtualScrollable && t.virtualScrollable.setDataSource(t.options.dataSource),
        t.options.navigatable && t._navigatable(),

        // problem line commented out
        //t.selectable && t._selectable(),

        t.options.autoBind && e.fetch();
    } 

This works well, except we can no long select grid rows.
Please let me know how I can get around this problem and reset selectable so that it works after calling code.

I have tried  grid.options.selectable = true; with no success.

Thanks,

Bradley












13 Answers, 1 is accepted

Sort by
0
Bradley
Top achievements
Rank 1
answered on 28 Aug 2014, 03:22 PM
Please do not ask for more code, as this problem with grid.setDataSource() occurs no matter where this function is called.

When using the previous Kendo UI js file, kendo.all.js along with kendo-angular.js, we had not problem calling grid.setDataSource()
0
Bradley
Top achievements
Rank 1
answered on 28 Aug 2014, 03:24 PM
To be more precise, when calling upgraded grid.setDataSource() what we see on the grid when the process hangs up is what you see in the attached image. 
0
Bradley
Top achievements
Rank 1
answered on 28 Aug 2014, 04:58 PM
If I replace grid.setDataSource() with version from previous version of kendo.all.js, (see below), then I have the same issue, so problem is not with grid.setDataSource(), but with the line that sets selectable, in this case,   that._selectable(); If I comment out this line, process works fine, but leaves grid with ability to select a row.


method using earlier version of grid.setDataSource():

var setDataSource = function(dataSource){

        var grid = $('#mainGrid').data("kendoGrid");
        var that = grid;
    
        that.options.dataSource = dataSource;

        that._dataSource();

        that._pageable();

        that._thead();

        if (that.options.groupable) {
            that._groupable();
        }

        if (that.virtualScrollable) {
            that.virtualScrollable.setDataSource(that.options.dataSource);
        }

        if (that.options.navigatable) {
            that._navigatable();
        }

        if (that.selectable) {
           
            that._selectable();
        }

        if (that.options.autoBind) {
            dataSource.fetch();
        }

    }
0
Dimo
Telerik team
answered on 29 Aug 2014, 02:11 PM
Hello Bradley,

Indeed, currently there is a compatibility issue, which occurs when using frozen columns, selection and setDataSource at the same time. We will do our best to address it as soon as possible.

Regards,
Dimo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Bradley
Top achievements
Rank 1
answered on 29 Aug 2014, 08:54 PM
Dimo,

Thanks for reply. 

Do you have any idea about workarounds?

I currently comment out line of setDataSource() that sets selectable, and all works except we lose our ability to select a row. I have tried to reset grid.options.selectable to true, which succeeds in resetting this option, but does not help in selecting a grid row.
 
Perhaps a way of dynamically locking and unlocking columns, or maybe resetting selectable default to true.

Thanks,

Bradley



0
Bradley
Top achievements
Rank 1
answered on 30 Aug 2014, 12:11 AM
Dimo,

Can you clarify frozen vs locked, as our columns are locked? It seems all columns cannot be locked, and if all columns are unlocked, data is not returned. Is this correct?

Is commenting out line in setDataSource: selectable&&selectable(), the cause of losing the selectability of a grid row?

Thanks,

Bradley
 
0
Dimo
Telerik team
answered on 01 Sep 2014, 07:49 AM
Hello Bradley,

"Frozen" and "locked" columns signify the same thing.

Commenting out the selectable() method inside setDataSource() will indeed disable the Grid selection, as it will not be initialized.

As I mentioned previously, the Javascript error occurs when locked columns, selection and setDataSource are used at the same time. Removing one of these will resolve the issue. If this is not an option, then I recommend waiting for the Kendo UI service pack, which will be released this week. We will try to fix the problem by then.

Regards,
Dimo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Bradley
Top achievements
Rank 1
answered on 01 Sep 2014, 02:33 PM
Dimo,

Thanks for reply. How will we know if issue is fixed with this week's service pack release?

Thanks,

Bradley
0
Bradley
Top achievements
Rank 1
answered on 01 Sep 2014, 03:06 PM
Dimo,

One more question:

You refer to using locked columns;  but my experience is that we have no choice - when I unlock all columns data is not returned.

Am I missing something - is it possible to unlock all columns and have data returned?, and if so, will all other processes proceed as expected.

Also, I am not clear on what will happen if I unlock all columns. I have done this and see an issue with columns lining up and being where user expects them.

Thanks.

Bradley
0
Accepted
Dimo
Telerik team
answered on 03 Sep 2014, 08:54 AM
Hello Bradley,

Our release notes provide information about the particular issues fixed in a given Kendo UI version.

http://www.telerik.com/support/whats-new/kendo-ui/release-history

On a side note, I can confirm that the discussed Javascript error problem has been resolved.

>> "when I unlock all columns data is not returned" - probably there is a Javascript error on the page

>> "I am not clear on what will happen if I unlock all columns." - if the Grid has been initialized with at least one locked column, you can't unlock all columns, and vice-versa - if the Grid has been initialized without any locked columns, you can't lock a column

>> "I have done this and see an issue with columns lining up and being where user expects them" - can you provide a demo of this behavior?

Regards,
Dimo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Bradley
Top achievements
Rank 1
answered on 03 Sep 2014, 10:01 AM
Dimo,

Thanks.

Bradley
0
Bradley
Top achievements
Rank 1
answered on 03 Sep 2014, 10:15 PM
Dimo,

I downloaded updated Kendo UI, which I believe to  be SP2, just released with the fix we need, and works ok, but I do not see release notes for it, as release notes are old release notes. Am I mistaken that I downloaded newest SP released this week?

Thanks,

Bradley
0
Dimo
Telerik team
answered on 05 Sep 2014, 09:50 AM
Hello Bradley,

The release is SP1 and release notes are available at the previously provided URL.

Regards,
Dimo
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
Bradley
Top achievements
Rank 1
Answers by
Bradley
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or