Forum

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

Search Forums:


 






calling of dataInit and dataEvents after the control are placed on the page

UserPost

13:17
05/09/2012


OlegK

Germany

Member

posts 1210

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 

19:19
10/09/2012


tony

Sofia, Bulgaria

Moderator

posts 7383

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.

10:56
07/11/2012


tony

Sofia, Bulgaria

Moderator

posts 7383

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.

13:25
07/11/2012


OlegK

Germany

Member

posts 1210

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 


About the jQuery Grid Plugin – jqGrid forum

Most Users Ever Online:

215


Currently Online:

16 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