jQWidgets Forums
jQuery UI Widgets › Forums › Grid › GridElement – cellsrenderer code executed on every cell click
This topic contains 5 replies, has 2 voices, and was last updated by Peter Stoev 10 years, 7 months ago.
-
Author
-
Hi jqwidgets team,
I have noticed a performance issue in our grid implementation, especially for Internet Explorer.
The cause of this performance issue seem to related to the fact that the “cellsrenderer” code is executed not only when the grid is rendered, but on every cell click/select and for all cells in the grid.It means that for a grid with 40 cells, on one cell click there are 40 calls of the cellsrenderer code.
Is there a way to improve this?
Regards,
IoanaHi Ioana,
“cellclick” does not re-render the Grid which means that you should do something in your code which raises re-render.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi Peter,
thank you for the quick reply.
My observation related to the “cellclick” was not only based on my code, but also on one of jqwidgets examples (one that uses cellsrender) where I made the grid editable. In the cellsrenderer function I added a log message “console.log(“cells renderer for: ” +row+ ” and column: ” +columnfield);”.
On cellclick I can see the logged message not only once, but many times.See: http://jsfiddle.net/ioana_v/7d0o02xL/2/
Regards,
IoanaHi Ioana,
on cell click you open an editor and that is the reason for such behavior. When you open an editor, the Grid will make the necessary rendering operations to display the editor. If you do not want that to happen on each click, just don’t open your editors on single click.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi Peter,
On a cell click (or cell select) the Grid should make the necessary rendering operations for the selected cell, not for the entire grid – in my opinion.
Your suggestion – if I understood correctly is to have a non editable grid that became editable on cell selection or cell click.
Our requirements are to have a very easy and quick way to select and edit cells, for example use tab key to select and edit the selected cell (like in Excel – or in the http://jsfiddle.net/ioana_v/7d0o02xL/2/ example).So the suggested workaround will not really fit to our requirements.
Regards,
IoanaHello Ioana,
Sorry, to hear about that, but we do not have other suggestion for you. On click you open an editor, that is ok, but it affects the rendering, too and that will be in future versions as well.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.