Forum

May 22nd, 2014
A A A

Please consider registering
guest

Log In Register

Register | Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

    

Wildcard usage:
*  matches any number of characters    %  matches exactly one character

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

Topic RSS
calling of dataInit and dataEvents after the control are placed on the page
05/09/2012
13:17
OlegK
Germany
Member
Forum Posts: 1216
Member Since:
10/08/2009
Offline

Hallo Tony,

I tought about the problem which I described here many time, but I forgot to write the suggestion as the feature request.

The problem is following. The current implementation of jqGrid call dataInit and dataEvents directly after creating the corresponding control and before the control are placed on the HTML page as the child of the corresponding cell. One has many problems as the consequence of the method. As the result one have to place frequently the code of dataInit inside of setTimeout which is not nice.

I can describe the problem on the following example. One have for example textarea control (edittype: 'textarea') and uses the inline editing. In the case jqGrid do the following:

  1. inside of inline editing module it calls $.jgrid.createEl (see the line)
  2. inside of grid.common.js module it creates textarea control with document.createElement("textarea") (see the line)
  3. after that inside of grid.common.js module it makes some initializations of the control (see the lines) inclusive calling of internal setAttributes function.
  4. then one calls internal bindEv function which calls dataInit and dataEvents (see the line)
  5. after that some additional attributes will be set on the control (see the line for example)
  6. Then (inside of inline editing module) it adds "editable" class to the cell (see the line)
  7. inside of inline editing it places the textarea control on the HTML page with $(this).append(elc); (see the line)

I find that it would be very good to make internal bindEv function accessible per $.jgrid.bindEv and move the call of bindEv from $.jgrid.createEl to the corresponding editing module. In the above example one could call $.jgrid.bindEv at the end of all described above steps.

After such changes the code of many implementations of dataInit could be run without usage of tricks like setTimeout.

Alternatively one could consider to call $.jgrid.bindEv event more later after all controls in the editing row will be placed on the page.

Best regards
Oleg 

10/09/2012
19:19
tony
Sofia, Bulgaria
Moderator
Forum Posts: 7580
Member Since:
30/10/2007
Offline

Thanks Oleg,

This a good recommendation actaully. Will do it later this week.

Thanks

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.
07/11/2012
10:56
tony
Sofia, Bulgaria
Moderator
Forum Posts: 7580
Member Since:
30/10/2007
Offline

Hello Oleg,

I have made the changes in GitHub. I need to perform moree deep tests, but for now it is ok.

Thanks.

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.
07/11/2012
13:25
OlegK
Germany
Member
Forum Posts: 1216
Member Since:
10/08/2009
Offline

It's very good news! Thank you! I will test the code later. If I would find a problem I will post it you.

Best regards
Oleg 

Forum Timezone: Europe/Sofia

Most Users Ever Online: 215

Currently Online: ilagi, NoSalt
73 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1216

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11239

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10442

Posts: 30864

Newest Members: re-gor, NoSalt, 80vele, George, Mallia, Sneha Mehta

Moderators: tony (7580), Rumen[Trirand] (81)

Administrators: admin (61)

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information