EasyUI Forum
March 28, 2024, 01:23:09 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Grid init issue  (Read 8041 times)
lcsft
Newbie
*
Posts: 7


View Profile
« on: March 05, 2015, 03:17:35 AM »

Hello,

I am using version 1.4.1 for quite some time now, and working on a complex system. I have a tab system with at least 3 tabs, each containing a grid. There seems to be a problem with the grid init, when it loads most of the times it gives this error:
Code:
TypeError: $.data(...) is undefined
var _6f8=$.data(jq[0],"datagrid").options;          jquery.easyui.min.js (line 9607, col 9)

TypeError: $.data(...) is undefined
return $.data(jq[0],"datagrid").panel;                jquery.....min.js (line 9618, col 7)

I interpret this as the DOM elements are not fully rendered by the browser but the init code of the grid is called (to early) or it may be related to the tabs, but it also happens on pages with a single tab and a single grid (just less often) If I add some setTimeout delay, then 90% of the time the bug disappears, but the slower the PC is, the more often this issue occurs. Or the more grids you open the same time, the more often this happens.
This doesn't crash the whole framework, if you close the tab and open it again most often it works, but it's pretty annoying/problematic.

I can reproduce this as: click on a link that opens the tab, and while the browser stalls a bit (rendering the elements) - meaning the tab appears, but it's content is not yet rendered, if I click on this tab, 99% I get this error (that the grid inside this tab won't initialize but give the above error). This doesn't mean that if you don't click on the tab, it won't happen, it will still happen but with less regularity.

any ideas/solutions?
Thank you.
« Last Edit: March 05, 2015, 03:22:11 AM by lcsft » Logged
zhcnlei
Newbie
*
Posts: 14


View Profile Email
« Reply #1 on: March 05, 2015, 10:35:24 PM »

You can try to provide some code or a reference patch.
Logged
zhcnlei
Newbie
*
Posts: 14


View Profile Email
« Reply #2 on: March 05, 2015, 11:17:27 PM »

If you use iframe in tabs the "conent", the script from the network, may be slow to load.
Prevent users from early action (for example:modal), or to improve the script loading speed.
Logged
lcsft
Newbie
*
Posts: 7


View Profile
« Reply #3 on: March 10, 2015, 02:05:28 AM »

Thx for the suggestions,
seems that upgrading to 1.4.2 with the jquery 1.11, the problem has gone away, or at least I could not get the problem from 20-30 clicks (before at least once out of 10 tab openings I got at least once).

The server access is indeed slow, but I can't improve that. How can I use the modal on tabs? I couldn't find it in the documentation.

thank you again.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!