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

noRecords logic doesn't run on hidden grids

2 Answers 17 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brian Roth
Top achievements
Rank 1
Brian Roth asked on 24 Aug 2015, 10:18 PM

I've run into an issue with the noRecords functionality.  We have a Kendo tabstrip with two tabs - one grid on each tab.  The user can add records in either of the grids which could result in a change to the data behind the other grid.  So adding a record in Tab1 - Grid1 will cause Tab2 - Grid2 to be refreshed.  I​f this happens and then the user changes tabs to Tab2, then Grid2 shows the new data but still shows the noRecords template as well.  I've traced this down to the _renderNoRecordsContent() function.  In that function, the logic only runs if the grid's wrapper is visible:

 

        _renderNoRecordsContent: function() {
            var that = this;

            if (that.options.noRecords && that.wrapper.is(":visible")) {

In my situation, the non-active tab fails this wrapper visible check.  So when rebind a grid programmatically on a non-active tab, the noRecords logic won't fire.  Is there a good way around this?  Or is the :visible check maybe a little too aggressive of a filter?

 

Thanks for your help!

 

Regards,

Brian

2 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 26 Aug 2015, 03:30 PM
Hello Brian,

We recently removed the mentioned visibility requirement and changes will take effect in the next internal and official Kendo UI builds. In the meantime, you can call the Grid's refresh() method when the widget becomes visible, and the  "No Records" message will appear.

http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#methods-refresh

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

Thanks!  Looks like this is in the internal build that was posted earlier today.  I appreciate the fast response!

 

Brian

Tags
Grid
Asked by
Brian Roth
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Brian Roth
Top achievements
Rank 1
Share this question
or