ryansuitposungkono / openjs-grid

Automatically exported from code.google.com/p/openjs-grid
0 stars 0 forks source link

rowclick function not working #30

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. grid pager set to show 5 rows on a table with more than 5 rows
2. click the next button to show the next page
3. rowclick function is not called

What is the expected output? What do you see instead?
row click works fine untill you click on next or back, or if you try to sort by 
columns, then rowclick function no longer works

What version of the product are you using? On what operating system?
latest version, seems to be reproduced in all browsers.

Please provide any additional information below.

Original issue reported on code.google.com by stephen...@gmail.com on 23 Sep 2011 at 1:57

GoogleCodeExporter commented 9 years ago
Ah, it needs to be .live() instead of .click() good call

Original comment by Seancla...@gmail.com on 11 Oct 2011 at 3:07

GoogleCodeExporter commented 9 years ago
Could you elaborate? What is "it"? Could you either provide the code snippet to 
resolve the issue or post a new grid.js?

Thanks!

Original comment by cp2bos...@gmail.com on 16 Oct 2011 at 7:55

GoogleCodeExporter commented 9 years ago
The event listener for rows is a jquery .click() and it needs to be a jquery 
.live() so that it works even with new rows added onto the page.

So that will be fixed in the upcoming release.

Original comment by Seancla...@gmail.com on 17 Oct 2011 at 12:01

GoogleCodeExporter commented 9 years ago
Hi! have you got this fixed? I'm having the same problem... Even using the 
search box disables rowclick :( Or maybe you can tell us the .js lines to be 
fixed and we can do it while the next version is released :)

Thanks for this great grid!!

Original comment by megasuba...@gmail.com on 21 Feb 2012 at 7:58

GoogleCodeExporter commented 9 years ago
mmm... I'm guessing the error is @ line 285

if(rowClick) $newRow.click(rowClick);

which needs to be replaced with something like .live("click",function(e)

but I'm not getting it right, I'm not that proficient in js :) Pleaseee heeelp!!

Original comment by megasuba...@gmail.com on 22 Feb 2012 at 8:40

GoogleCodeExporter commented 9 years ago
Here's the fix I did yesterday:

----------------------------------------------------
1) Open file "grid.js"
2) Go to line 283, replace:
             var $newRow = $("<tr primary_key='"+primaryKey+"'>");
    with
             var $newRow = $("<tr primary_key='"+primaryKey+"' class='liveRow'>");
3) Go to line 285, replace:
             if(rowClick) $newRow.click(rowClick);
    with
             if(rowClick) $(".liveRow").live("click", rowClick);

4) Ready & Fixed!! :)
----------------------------------------------------

I hope you find it useful :)

Original comment by megasuba...@gmail.com on 11 Aug 2012 at 2:43