jQuery UI Widgets › Forums › Grid › beginupdate and endupdate
Tagged: beginupdate, cellsrenderer, endupdate, grid, jqxgrid, render, setcolumnproperty
This topic contains 7 replies, has 2 voices, and was last updated by Dimitar 9 years, 9 months ago.
-
Author
-
Hi,
I was reading about beginupdate and endupdate methods. I didn’t understand their working.As I am setting two columns text by using following code.
$("#jqxgrid").jqxGrid('beginupdate'); $('#jqxgrid').jqxGrid('setcolumnproperty', 'text_translated', 'text', new_name + ' Unicode'); $('#jqxgrid').jqxGrid('setcolumnproperty', 'text_translated_ansi', 'text', new_name + ' ANSI'); $("#jqxgrid").jqxGrid('endupdate');
But nevertheless, grid get rendered two times. What is the reason ? I want that Grid would render only one time.
Hello Tahir Nazir,
Here is an excerpt from the jqxGrid API documentation about beginupdate which may shed some light on the matter for you:
Starts an update operation. This is appropriate when calling multiple methods or set multiple properties at once. Optional boolean parameter: suspendAllActions. When you call beginupdate with parameter equal to true, the jqxGrid stops all rendering processes and when you call “endupdate”, it will call the “render” method. Otherwise, it will try to resume its state with minimial performance impact. Use the suspendAllActions when you make multiple changes which require full-rerender such as changing the Grid’s source, columns, groups.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hello Dimitar,
I have already read thoroughly documentation and every stuff. But, I didn’t find the way that how to enable the Grid to render only one time in context of above given code. As above given code render the Grid two times…Hi Tahir Nazir,
This explanation means that if you want to render the grid only once, call beginupdate with parameter true, i.e.:
$("#jqxgrid").jqxGrid('beginupdate', true);
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hello Dimitar,
I have tried with true parameter too. but still Grid get rendered two times.Hi Tahir Nazir,
We investigated this issue. If by “rendered” you mean calls to the cellsrenderer function, this is a normal behaviour and cellsrenderer is not suspended by beginupdate/endupdate.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hi Dimitar,
thanks again for your kind reply. Can you guide me that is there any way to suspend the cellrendere in the above given scenario?Kind Regars
Hi Tahir Nazir,
There is no way to achieve this, unfortunately. You may, however, be able to execute code from cellsrenderer selectively with the use of flag variables.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.