Forum
12:46
10/08/2009
Hello Tony,
there are a bug in cell editing of grid having subgrids as grid. If cell of subgrid will be clicked the click event will be fire twice: one for the subgrid and one more time for the main grid. The reason is easy – both grids have registerd click event (see the line 2276 of grid.base.js). The problem is that click event in the main grid will be wrong processed. Firsts it will be found <tr> element
in the subgrid and then will be calculated indexes
ci = $.jgrid.getCellIndex(td);
also in the subgrid, but the next line
uses the indexes from the subgrid to start editing of the cell in the main grid. So instead of editing of one cell in the subgrid one start additionally editing one more cell in the main grid.
In my opinion the easiest way to fix the problem is just to ignore the click event which is fired in the subgrid during click processing in the main grid. One can do this for example by changing the line 2279 of grid.base.js from
to
The bug can one see live on the demo. After the bug fix the editing work correct (see the fixed demo).
The bug and the fix is described in my answer here.
Best regards
Oleg
12:55
Moderators
30/10/2007
Oleg,
Thanks again,
This seems reasonable, but what about when we have 3 and more levels subgrids ?
Should think
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.
13:21
10/08/2009
Hello Tony,
the fixed demo seems work good with many level of subgrids. Which problem you see here? What behavior you expect and what you see?
Regards
Oleg
13:17
12/10/2010
UPDATE :
Realised my problem.
Went back to the source file, made the change, and minified it.
Solved. Thanks for the bug fix.
Regards
Paul.
------------------------------------------
Hi OlegK
I am having this problem.
I downloaded the latest version of jqGrid (4.2) today which I don't think contains the fix.
I searched for the LINE you mentioned should be changed, but could not find it.
Wondering which version should I be working with, in order to get this working…?
Either to be able to apply the fix, or find one that contains the fix?
I use the file jquery.jqGrid.min.js which contains all code, for all options – As downloaded with all options selected.
Can you help?
Regards Paul
13:54
10/08/2009
Hello Paul,
if you need make any modifcation in the jqGrid code you need use jquery.jqGrid.src.js instead of jquery.jqGrid.min.js. If you really need to use the file in production you can create minimized version of the file yourself. To do this you can choose any your favorite minifier. Just search in internet for the words JavaScript and minifier and you will find many versions from there. Every has its advantages and disadvantaged. The first well-known minifier was JSMin. There are Closure Compiler, Microsoft Ajax Minifier, YUI Compressor, and so on.
You can compare the results of different minifires here. Corresponds to the tests the best restults you will get with the Closure Compiler. In case of the usage of jquery.jqGrid.min.js on the web server with enabled compression you need look at the size of GZIPed version of the file.
In my experiments with the current version of Closure Compiler
I got file jqGrid.min.js with the size 185.981 bytes. It's better as 239.659 bytes of the jquery.jqGrid.min.js from trirand download. The problem with the usage ofADVANCED_OPTIMIZATIONS parameter that to use it correct one need create the list of extern methods (see here). Only after that one will have not only small, but also working code. If you don't want invest your time in creating the list of extern methods you can use Microsoft Ajax Minifier. In my tests the ms-minimized version of jquery.jqGrid.src.js has the size 234.088 and gziped: 64.546 which is smaller as 239.659 and 66.938 correspondingly for jquery.jqGrid.min.js from trirand download.
@Tony: If you find time you can play a little with Closure Compiler. Probably you can use it in the official jqGrid download package?
Best regards
Oleg
Most Users Ever Online: 715
Currently Online:
45 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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66