This table is generated using GridX / dojo in NodeWebkit. The "[BV][B][V]" are links that are handled by jQuery using class selector. However, once I sort the grid, the listeners are unbinded. How do I reapply the click function? Is there a callback when sorting & rendering is complete?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- How to fix IE ClearType + jQuery opacity problem i
- void before promise syntax
- jQuery add and remove delay
I created a wrapper div and added the click listener to it as -
gridWrapper
is not changed. So the listener remains active and the.myLinkClass
selector selects the<a href="#" class="myLinkClass">text</a>
in spite of sorting.Like @mccannf initiated I use the re-rendering event. For preventing double working I just use a counting variable and do the work only the second time.
Note: If at initial the grid is empty than I set the counter to 1 because than the event is only called once.
There is no callback or event that I know of when sorting is complete in gridx.
However, the whole grid is re-rendered when it is sorted or filtered. So you can use something like: