Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
3.7.1 tree grid slow to expand or collapse nodes
Tags: tree
16/06/2010
17:43
Avatar
Les
Member
Members
Forum Posts: 44
Member Since:
11/12/2009
sp_UserOfflineSmall Offline

I just upgraded from 3.6.5 to 3.7.1 and I see a big boo-boo. Cry

When you click a tree node it expands or collapses much slower compared to the previous release.

I see a large difference in IE7.  It feels really slugish.

17/06/2010
13:22
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Thanks for considering this. Also we make the tree grid in mind that this way it will be faster!?!

Since it is a very difficult to determine where the problem is, could you please send me a link to the problem,

so I can see what is happen.

Thank you

Best Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

17/06/2010
15:48
Avatar
Les
Member
Members
Forum Posts: 44
Member Since:
11/12/2009
sp_UserOfflineSmall Offline

Tony,

I see that you made some code changes in the way tree grid row expand and collapse in 3.7.1.  I'm almost certain this is the cause of performance degradation.

The problem is easy to reproduce.  Just try to access the jqGrid demo application:

http://trirand.com/blog/jqgrid.....qgrid.html

Click for instance on "New in Version 3.5".  The demo application is using 3.7.1 and you will see that the rows expand and collapse slowly with just 9 children.  This used to be fast in the previous 3.6.5 version.

Majority of my users use old Pentium laptops (Win XP and IE7), which I used for testing.

I you want I can upload a test application.  It's rather large but very easy to install.

20/06/2010
09:29
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

I do not see such problem, or maybe my computer is not like your that you test.

Also I will try with more nodes.

Best Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

20/06/2010
18:03
Avatar
Les
Member
Members
Forum Posts: 44
Member Since:
11/12/2009
sp_UserOfflineSmall Offline

Tony,

I did some more testing and I have measurements taken on another faster computer.

I inserted console.tiime and console.timeEnd in this click handler in 3.6.5 and 3.7.1 (Firefox 3.6.3 and Win XP)

$(".treeclick",row).bind("click",function(e){

See the results on pictures (3.7.1 is 10 times slower)

jqGrid 3.6.5

http://img191.imageshack.us/im.....ree365.png

jqGrid 3.7.1

http://img217.imageshack.us/im...../treew.png

I'd like to work with you to resolve this issue.  Please let me know what else I can do. 

21/06/2010
04:08
Avatar
Les
Member
Members
Forum Posts: 44
Member Since:
11/12/2009
sp_UserOfflineSmall Offline

Tony,

Performance of expandRow() and collapseRow() in 3.7.1 will improve if you remove the context, see below.

The context is not needed because the query (by ID) maps almost directly to document.getElementById.

collapseRow : function (record) {

...

//$("#"+id,$t.grid.bDiv).css("display","none");

$("#"+id).css("display","none");

expandRow: function (record){

...

//$("#"+id,$t.grid.bDiv).css("display","");

$("#"+id).css("display","");

21/06/2010
04:48
Avatar
Les
Member
Members
Forum Posts: 44
Member Since:
11/12/2009
sp_UserOfflineSmall Offline

The same change can be made in 3.7.1 in expandNode() and collapseNode() - don't provide context when the query is by id.

I made this change and now performance is the same as in 3.6.5.

21/06/2010
05:00
Avatar
Les
Member
Members
Forum Posts: 44
Member Since:
11/12/2009
sp_UserOfflineSmall Offline

I found post this which explains that passing a context will slow things down when query is an ID.

http://stackoverflow.com/quest.....th-context

25/06/2010
10:06
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

First of all thank you very much for the investigations and recommendations.

I'm ready to do this, but imagine that you have two grids on the same page. It is quite possible thet both have same id,

in this case the collapsing and expanding maybe will not work, becouse it will depend which id will be find first.

Will see how to improve this.

Best Regards

and thanks again

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

25/06/2010
15:47
Avatar
Les
Member
Members
Forum Posts: 44
Member Since:
11/12/2009
sp_UserOfflineSmall Offline

Tony,

I just wanted to point out that by HTML spec element IDs must be unique in a document

http://www.w3.org/TR/html401/s.....ml#h-7.5.2

I'm painfully aware that the jqGrid will create elements with duplicate ids (not only in rows but also in column headers) when there are two grids populated with the same data.

I hope you realize that this is a really bad design.  Right now you have two problems: the markup is still bad and the grid is much less scalable because you added an inefficient piece of JavaScript to guard against the bad html.

I suggest instead of introducing new features, you concentrate on fixing the underlying architecture. 

Les

25/06/2010
15:58
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Thanks Les. Absolutley you are right, but if we fix this, nobody can continue to use the new versions – they should rewrite your code from the beginning.

For the column headers and other duplicate ids we can fix these, but the big questions is what to do with the rows ids?

Example: I have a table with primary keys 1,2,3.. and another table with the same primary keys numbering due of using the autoincremet property and I want to use these keys when I do CRUD operations.

In the same time I need to display both grids in one page - so the question is: how we can make these rows uniquie and in the same time to use the primary keys values?

Best Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

25/06/2010
16:10
Avatar
Les
Member
Members
Forum Posts: 44
Member Since:
11/12/2009
sp_UserOfflineSmall Offline

Tony,

Perhaps you will need to make some tough decisions and brake backward compatibility in order to fix the markup.

Right now we are not able to upgrade to 3.7.1, and it's not because of the duplicate ids but because of the JS patch that you added to guard against the duplicate ids.

Les

25/06/2010
16:38
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello Les,

The same will hapen if we do the change.

Instead I have begin a serious research on treeGrid and we will increase the speed .

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

19/10/2010
11:39
Avatar
aurelien.pernoud
Member
Members
Forum Posts: 5
Member Since:
28/07/2009
sp_UserOfflineSmall Offline

Hello tony,

did you by any chance have a look at optimizing treegrid (not only expandRow and collapseRow, but also loading) ?

I've tried 3.8 version with latest jQuery UI but except the expandRow and collapseRow that are indeed really slower (we used 3.6.4 before), loading is the same.

Thanks for your feedback.

Aurélien

27/10/2010
05:24
Avatar
waiting
Member
Members
Forum Posts: 40
Member Since:
22/12/2008
sp_UserOfflineSmall Offline

tony said:

For the column headers and other duplicate ids we can fix these, but the big questions is what to do with the rows ids?

Example: I have a table with primary keys 1,2,3.. and another table with the same primary keys numbering due of using the autoincremet property and I want to use these keys when I do CRUD operations.

In the same time I need to display both grids in one page - so the question is: how we can make these rows uniquie and in the same time to use the primary keys value


Hello Tony,

In my option, i should make it by this way:

use grid-container-id (eg. 'treegrid') as prefix of rows ids (eg. 'treegrid_1/treegrid_2/treegrid_3'). when CRUD then substr the prefix -- this action can be done by client side before starting post, or by server side after receive the post data (must post the prefix  as individul key:value  togather)

waiting

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
46 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information