jQWidgets Forums

jQuery UI Widgets Forums Grid Sync Grid Data Source

This topic contains 2 replies, has 2 voices, and was last updated by  miker55 10 years, 7 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Sync Grid Data Source #60726

    miker55
    Participant

    Hello,

    I have a jqxgrid bound to a JSON data source. What I would like to do is bind the grid to my JSON data source, which in this case comes from Angular so it is a $scope property. Then when the user clicks save, I want to just send the updated data source, again from the $scope property, to the server for a batch update. It appears though that the grid must use a copy of the data source because none of my grid edits show up in my original data source property.

    Is there a way to “flush” the grid’s data source back out to the original source property? I don’t want to update it row-by-row which seems to be the default.

    Also, what is the advantage to going through a data adapter as opposed to just binding the grid directly to the data source? Both approaches seem to work, aside from the aforementioned sync issue, so I’m not sure what the difference is.

    Thanks!

    Mike

    Sync Grid Data Source #60728

    Peter Stoev
    Keymaster

    Hi Mike,

    There is no advantage. You always use dataAdapter. The Grid’s source object has “addrow”, “updaterow” and “deleterow” callbacks which you should use to synchronize the user’s input with the model. Also please post your future questions about using the Grid with AngularJS in our AngularJS Forum because this would probably help to other users which use jQWidgets with AngularJS

    Best Regards,
    Peter Stoev

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

    Sync Grid Data Source #60729

    miker55
    Participant

    That answers my question. Thanks for the quick response, Peter.

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

You must be logged in to reply to this topic.