Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OnRender Event handler #597

Closed
oloo opened this issue Apr 25, 2013 · 8 comments
Closed

OnRender Event handler #597

oloo opened this issue Apr 25, 2013 · 8 comments

Comments

@oloo
Copy link

oloo commented Apr 25, 2013

i am trying to customize the background color of particular cells basing on values entered in other cells . This seems to work but the coloring is lost when i scroll across the table (i have horizontal scrolling enabled). I believe the table is re re-rendered each time a user scrolls so i think it would be possible to reset the background coloring with an OnRender event handler. Is there such a provision?

@warpech
Copy link
Member

warpech commented May 7, 2013

Yes, HOT rerenders whole table after cell is scrolled.

Your problem should not be addressed with a callback but with cell renderers. Learn more about cell renderers here: http://handsontable.com/demo/renderers.html

Anyway, Handsontable 0.9.0-beta1 adds new callback afterRender. You are welcome to test it. Until it is merged with master branch, you will need to checkout 0.9 branch

I will close this ticket when version 0.9 goes out of beta.

@warpech warpech closed this as completed May 7, 2013
@warpech warpech reopened this May 7, 2013
@oloo
Copy link
Author

oloo commented May 7, 2013

Thanks for the feedback. I had a look at cell renderers and i use them quite a bit but they didn't quite serve this particular purpose. let me checkout the 0.9 branch and do some testing.

@warpech
Copy link
Member

warpech commented May 7, 2013

Indeed cell renderer was not enough? If you want to change background color of a cell, based on the value of another cell, you can call instance.getData() in your cell renderer to get access to other cells' values.

@oloo
Copy link
Author

oloo commented May 7, 2013

Please correct me if i am wrong but i believe you cannot use the cell renderer when the cell data you want to base on to color other cells is entered by the user after the table has been rendered.

@setthase
Copy link

@oloo - here you got example how to refresh cell renderer: #646 (comment)

@warpech
Copy link
Member

warpech commented May 11, 2013

@oloo - well, the table is rerendered after each data change - so you can. If not, you can always force rerendering using "render" method.

@oloo
Copy link
Author

oloo commented May 11, 2013

Ah rerender should do the trick. Thanks
On 11 May 2013 13:40, "Marcin Warpechowski" notifications@github.com
wrote:

@oloo https://github.com/oloo - well, the table is rerendered after
each data change - so you can. If not, you can always force rerendering
using "render" method.


Reply to this email directly or view it on GitHubhttps://github.com//issues/597#issuecomment-17757827
.

@warpech
Copy link
Member

warpech commented May 21, 2013

Handsontable 0.9.0 now features a new afterRender callback!

More about new events here: https://github.com/warpech/jquery-handsontable/wiki/Events

@warpech warpech closed this as completed May 21, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants