Kendo UI grid - throw Error (kendo.format ("It is impossible to call the method" {0} "from {1} before its initialization", t, r))

I have a tabstrip with two tabs. On each tab, I have one grid with paging. My configuration for the grid is on the client side. When I quickly switch between tabs, I get an exception from javascript:

 "throw Error(kendo.format("Cannot call method '{0}' of {1} before it is initialized",t,r))" 

Below is the paging configuration section in the grid:

 [...] pageable: { pageSizes: [5, 10, 20], input: true }, [...] 

Do you know how to prevent this error?

+8
javascript user-interface grid kendo-ui
source share
2 answers

I ran into the same problem, and yes, there is a fix for it, basically you just need to destroy the grid before moving to a new tab ...

The best way to handle this is to use this function while it searches for the kendo grid and destroys them.

 $("[kendo-grid]").each(function(idx,kGrid){ var dataObj=$(kGrid).data(); for(mData in dataObj) { if(typeOf dataObj[mData] != "string") { if("destroy" in dataObj[mData]) { dataObj[mData].destroy(); } } } }) 

Hope this helps ...

0
source share

It is not clear what the problem is ... It seems like a problem with synchronization.

Try downloading content using async: false

-2
source share

All Articles