jQWidgets Forums

jQuery UI Widgets Forums Plugins AngularJS Binding in grids

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 10 years, 7 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Binding in grids #62788

    tjdo
    Participant

    Hello

    I’m currently testing jqWidgets for implementation in a rather large Angular app. While I really like the grid functionality, it seems there are potential deal breakers. But before I write off the grid, I wanted to see if this is a basic misunderstanding on my part.

    The jqWidget grids seem to break the paradigm of data binding. In fact, if I bind myData to a data adapter, there is no reference to myData through the grid. Additionally, making changes to myData or dataAdapter.records seems to have no impact on the display of the records themselves, and therefore there is no true binding. It seems all manipulation of records in the grid must be done through the grid API, and cannot be done directly to the data which is the initial source for the grid.

    The problem here is the potential impact on performance, and the overhead it having to be dependent upon the API to make simple updates to the data. If I MUST manipulate data via the grid API and not via the data directly, there’s also a significant amount of manual synchronization that will need to occur. Part of the purpose of using Angular is to take advantage of data binding for this reason.

    For instance, if I want to update a column, I would generally just update the source array members:

    myData[i].isSelected = true;

    Then data binding would handle the updates to any references, including displayed references. This does not seem possible for the jqWidgets implementation.

    Are my assumptions correct?

    Binding in grids #62801

    Peter Stoev
    Keymaster

    Hi tjdo,

    When you bind Grid and want to update the Grid’s data, yes you have to use the Grid’s API to update its data i.e setcellvalue or updaterow methods. Then to synchronize that with your data source, you have to implement callback functions of the source object and depending on the Grid’s changes, you will make the updates in your data source. There are “updaterow”, “addrow” and “deleterow” callbacks. If you write something like myData[i].isSelected = true;, nothing will be changed due to the simple reason that nobody except you will know that you changed something.

    Best Regards,
    Peter Stoev

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

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

You must be logged in to reply to this topic.