Forum

July 10th, 2011
You must be logged in to post Login Register

Search Forums:


 






jqGrid TreeGrid SubGrid rewrite, code cleanup, keyboard navigation, jQuery 1.5.x tests
Read original blog post

UserPost

08:48
25/02/2011


admin

Admin

posts 60

Hello All,

After rewriting the Search module we have made the hard decision to rewrite the other two modules TreeGrid and SubGrid.
The reason for this lie in the concept of how these modules currently load the data -i.e after inserting every row we bind the appropriate events. This concept is not effective when the data is relative big. In such cases the TreeGrid throw a exception. Now we want to correct this problem binding the events at once.

Again with this we do some structure changes in the code. Lot of not used modules like grid.postdsata.js and grid.columns.js will be not more supported. They will be included into the download and moved to plugin directory. Also we have created another module named grid.addons.js. This module contain methods that will be no more supported. The full list of the methods will be know after a week. We have done some changes in GitHub, so you have a idea what we do.

Another good news is that we have realised (under development) a keyboard navigation in the Grid and Tree Grid. This will make jqGrid one of the best grids.

From today we begin intensive test with jQuery 1.5.1. If you encounter problems with this jQuery release please post it into the form with code example and data. Only these posts will be answered and eventually fixed.

As usual – any questions, comments, anything – is welcome. We are always listening and trying to improve.

Kind Regards
Yours jqGrid Team.


Read original blog post

19:28
25/02/2011


OlegK

Germany

Member

posts 1210

Hello jqGrid Team,

It's very good news that jqGrid will have better support of the keyboard navigation!

One more good news is testing of jQuery 1.5.1.

Some rewriting of old code is really needed from time to time. The usage of gridview:true allways also with TreeGrid and SubGrid would be very good in my opinion. I think that the best is to make all binding at the end of jqGrid creating (somewhere before calling of loadComplete). Probably the best place is to make binding and other required operations with DOM after the DOM for the whole jqGrid will be created (or at least the DOM of body: $("<tboby>…</tboby>")), but before it will be placed on the page. It seems to me that one will be have the best performance in the case.

It would be nice if jqGrid Team will try to include QUnit tests and JSLint in the general developing process like jQuery developers made some time ago. It could improve the quality of the code and the stability of jqGrid for changes. Especially after rewriting of large parts of code it would be fine to restart some old standard tests to localize possible compatibility issues.

Best regards
Oleg 


12:22
08/03/2011


pro85

Member

posts 5

Post edited 12:30 – 08/03/2011 by pro85
Post edited 12:31 – 08/03/2011 by pro85
Post edited 12:32 – 08/03/2011 by pro85


Hi Tony.

I test treegrid with example from http://www.trirand.com/blog/jq…..grid.html.

I copy html and data from New in version 3.4 -> Tree Grid Adjacency model.

Result:

In 3.8.2 it'ok. But in version from github this result.

I use jquery 1.5.1 jquery-ui 1.9m4.

nSrRUv38zw9X

14:29
08/03/2011


tony

Sofia, Bulgaria

Moderator

posts 7383

Hello,

Didd you replace all files from Git? – especially the grid.base.js – also you should not only replace the grid.treegrid.js.


Best Regards

Tony

For professional UI suites for PHP, ASP.NET and ASP.NET MVC visit us at our commercial products site – trirand.net – by the very same guys that created jqGrid.

17:56
08/03/2011


pro85

Member

posts 5

Hi Tony.

I update all files from github.


17:29
09/03/2011


tony

Sofia, Bulgaria

Moderator

posts 7383

For professional UI suites for PHP, ASP.NET and ASP.NET MVC visit us at our commercial products site – trirand.net – by the very same guys that created jqGrid.

19:21
09/03/2011


pro85

Member

posts 5

Thanks Tony for fixing problem :)

10:47
10/03/2011


pro85

Member

posts 5

Hi Tony.

I have some improvements for jqgrid.

Where can i send diff files?

04:38
11/03/2011


lonelystellar

New Member

posts 2

Hi.

i'm using the lasted version of jqGrid from Github

When i upgrade jquery to version 1.5.1, the ajax request breaks down. any ajax request turns to exception.

ps. i use the json format as my data input

but there is no problem with jquery 1.4.4

09:03
11/03/2011


tony

Sofia, Bulgaria

Moderator

posts 7383

Hello,

@pro85 – you can use GitHub. If you do not like this, please post itnto the forum and in the same time send it to me – (the forum formatting is not very good).

@lonelystellar, please look at my original post above:

"From today we begin intensive test with jQuery 1.5.1. If you encounter problems with this jQuery release please post it into the form with code example and data. Only these posts will be answered and eventually fixed."


Regards

Tony

For professional UI suites for PHP, ASP.NET and ASP.NET MVC visit us at our commercial products site – trirand.net – by the very same guys that created jqGrid.

18:58
14/03/2011


Wakamolee

Member

posts 5

Post edited 18:59 – 14/03/2011 by Wakamolee


There is a bug with custom search in jQuery 1.5.1 and tested versions 3.6.5 and 3.8.2 of jqGrid. When I press Enter to trigger the search:

  1. I get a "uncaught exception: Syntax error, unrecognized expression: [name=actividad:descripcion]" in firebug
  2. The page reloads with the GET parameters in the URL

Here's the setup and test data: http://pastebin.com/v8tBEDTL


PS: Also I'd like to mention that pagination values are incorrect since v3.7.2 when datatype:"jsonstring" as you can see in the same provided pastebin (http://www.trirand.com/blog/?p…..tion-v3-8/)

09:45
17/03/2011


lonelystellar

New Member

posts 2

bug report:

if I click add button on navigation bar at the first time, everything seems normally, the add page pops up, ok, close it. when i click add button again, nothing happens, and i get a javascript error in developer tool. following the error messages:


grid.formedit.js:483         Uncaught TypeError: Cannot read property 'type' of undefined


but when i click the edit button on nav bar there is no problem like i said above.


i use the lastest version on GitHub.


please check it out.

11:51
17/03/2011


OlegK

Germany

Member

posts 1210

Hello Tony,

I suggest to make small changes in the grid.base.js to allow to use data parameter for jqGrid to fill the Tree Grid. The change is very simple. I suggest to replace the line 1400 (return;) to the following

if (ts.p.data && ts.p.data.length > 0) {
    return { total: 1, page: 1, records: ts.p.data.length, rows: ts.p.data };
} else {
    return;

After then one can load the tree in both modes using the data parameter without needs to use additional addJSONData call after the grid or inside of loadComplete. See the demo and compare it with this one. Warning: I don't tested the changes together with local XML (xmlstring) datatypes.

Moreover, please read this my recent suggestion. During writing the answer on the stackoverflow it was clear for me, that one can make only one binding to the "click" event for the whole grid body (see here). Inside the event handle one can examine the clicked object and dispatch the call to the corresponding event handle, for example to the handle used to expand/collapse the tree node or to the handler of the actions formatter. It will work exactly like you dispatch the click to the onCellSelect event handle. The same behavior for the general formatter which need the click handle one can for example use new custom event 'cellClick.jqGrid' one for the whole grid. For example one can bind 'cellClick.jqGrid' event to the grid and call ts.trigger('cellClick', [rowid, iCol]) inside of the main click handle. If you need I can post a code example which will better explain what I mean.

By the way in the case one not only save some resourses need for the onclick event handle for all noded of the corresponding column. One don't need to make any jQuery call with the DOM element of the cell during filling of grid contain or use and "onclick" textes, so the code will stay unobtrusive like the rest of the jqGrid code. One can use gridview:true without any problem (but it is now already so).

Please Tony, think about the way. It seems very interesting for me.

Best regards
Oleg 

16:36
17/03/2011


tony

Sofia, Bulgaria

Moderator

posts 7383

Hello Oleg,

Thanks for the recommendation.

Also this is a good idea, but the realization is not appropriate.

Also in order to demonstarte:

Use your example, load the data – expand some or all the rows, sort on acc num  (or any other col) and now there is a problem.

I will see how can this be implemented.


Tony

For professional UI suites for PHP, ASP.NET and ASP.NET MVC visit us at our commercial products site – trirand.net – by the very same guys that created jqGrid.

18:09
17/03/2011


OlegK

Germany

Member

posts 1210

OK Tony, I see that local sorting is not work correctly. The first problem that I ised parent:"" instead of parent:null, but it is not the only problem.

Nevertherless it seems to me that Tree Grid is very close to support pure local data. Even with the restriction to have no local sorting it could be interestung.

To tell the truth I have almost no expirience in Tree Grid, but I am sure, that you can easy find the palaces in the code which made problems and probably also quickly fix the problem. I find the full support of local data would be fery fine feature of the jqGrid.

Best regards
Oleg

22:42
17/03/2011


pro85

Member

posts 5

Hi Tony.

I publish my changes to github.

https://github.com/pro85/jqGrid u can see the code.

Its allow use search filter in fixed place on page.

Example the search block under grid.

12:14
19/03/2011


ramanr

New Member

posts 2

Is there a working example to get treegrid work with the JSON data? Switching to xml works like a charm. But I cannod switch to XML as my existing data exchange format is JSON.

Oleg's example works but, again it involves adding the JSON data to the grid. Is there a way to make it work with JSON data as a response from a url?

- ramanr

00:13
21/03/2011


leewsimpson

Brisbane, Australia

New Member

posts 1

admin said: Another good news is that we have realised (under development) a keyboard navigation in the Grid and Tree Grid. This will make jqGrid one of the best grids.  


Do you have any details on the keyboard navigation?  And a timeline? (can I test it?)


Lee

15:03
23/03/2011


schabol

Poland

Member

posts 4

GitHub version of jqGrid dont woork with FireFox 4.0

http://freetree.pl/

15:03
23/03/2011


schabol

Poland

Member

posts 4

Post edited 15:05 – 23/03/2011 by schabol


GitHub version of jqGrid dont woork with FireFox 4.0 – Sorry for duplication :-( – Please Delate this post..

http://freetree.pl/


About the jQuery Grid Plugin – jqGrid forum

Most Users Ever Online:

215


Currently Online:

26 Guests

Forum Stats:

Groups: 1

Forums: 7

Topics: 10274

Posts: 30361

Membership:

There are 11038 Members

There have been 448 Guests

There is 1 Admin

There are 2 Moderators

Top Posters:

OlegK – 1210

markw65 – 179

kobruleht – 144

phicarre – 132

YamilBracho – 124

Renso – 118

Administrators: admin (60 Posts)

Moderators: tony (7383 Posts), Rumen[Trirand] (81 Posts)




Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information