jQuery UI Widgets Forums Grid beginupdate and endupdate

This topic contains 7 replies, has 2 voices, and was last updated by  Dimitar 9 years, 4 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • beginupdate and endupdate #64543

    Tahir Nazir
    Participant

    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.

    beginupdate and endupdate #64547

    Dimitar
    Participant

    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,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    beginupdate and endupdate #64558

    Tahir Nazir
    Participant

    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…

    beginupdate and endupdate #64559

    Dimitar
    Participant

    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,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    beginupdate and endupdate #64561

    Tahir Nazir
    Participant

    Hello Dimitar,
    I have tried with true parameter too. but still Grid get rendered two times.

    beginupdate and endupdate #64589

    Dimitar
    Participant

    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,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    beginupdate and endupdate #64597

    Tahir Nazir
    Participant

    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

    beginupdate and endupdate #64598

    Dimitar
    Participant

    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,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.