jQuery UI Widgets Forums Grid Knockout.js – grid out of sync with model.

This topic contains 2 replies, has 2 voices, and was last updated by  rssveen 11 years, 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author

  • rssveen
    Participant

    Hi all!

    I’ve just started using jqxGrid together with knockut.js.
    When deleting data from the model, only some of the rows are removed from the grid. If the action is repeated several times, the grid eventually becomes empty. When model data is switched, there is a similar “bug”.

    I’ve put together a simplified example of this issue, and tried posting it on jsfiddle.Can’t actually get it to work properly there, however it works locally.

    Anyways, the code of the example is complete – please have a look:
    http://jsfiddle.net/NKL5m/15/

    Thanks.

    Robin

    • This topic was modified 11 years, 2 months ago by  rssveen.
    • This topic was modified 11 years, 2 months ago by  rssveen.

    Peter Stoev
    Keymaster

    Hi Robin,

    Thanks for the sample code. The issue here is that the Grid when bound to KO is not capable to delete more than 1 row with 1 call i.e as a workaround you can use:

        while(model().length) model.pop();

    Best Regards,
    Peter Stoev

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


    rssveen
    Participant

    Thanks Peter,

    Is this the best practice for replacing grid data when bound via knockout?

    Do you have any plans to improve the way the grid binds via knockout, so that you support swapping more than one row at a time?
    The way i see it – optimally – the grid should just refresh itself no matter how the underying model is changed – as long as it’s bound via knockout.

    Best Regards,
    Robin

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

You must be logged in to reply to this topic.