jQWidgets Forums

jQuery UI Widgets Forums Plugins AngularJS assign settings object multiple times

This topic contains 2 replies, has 2 voices, and was last updated by  Peter Stoev 10 years ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • assign settings object multiple times #67048

    badera
    Participant

    Dear jqWidgets Team

    I like to know, if it is proper to re-assign a settings object of a jqx-widget. What I see is that it works, but I like to know if it is really designed for that.

    Example:

    JS:
    ...
    $scope.grid = {};
    $scope.$watch(function () {
            return $scope.operators
        }, function (newValue, oldValue, scope) {
            if (angular.isArray($scope.data) && $scope.data.length > 0) {
                $scope.gridSettings =
                {
                    ...
                    source: $scope.data,
                    ...
                }
            }
        },
        true);
    ...
    
    HTML:
    <jqx-grid jqx-settings="gridSettings" jqx-create="gridSettings" jqx-instance="grid"></jqx-grid>

    The grid settings are assigned in the angular watch. The only thing, which changes in aspect of the jqx settinsg is the source property; What I observe is that if the watch is triggered, the grid is correctly refreshed/updated according the new data… however, my question: is it OK to do that? If not, why?

    Thanks for your help.
    – badera

    assign settings object multiple times #67189

    badera
    Participant

    May I kindly ask for an answer? – Thank you!

    assign settings object multiple times #67244

    Peter Stoev
    Keymaster

    Hi badera,

    Note that this is Community forum and answers should be expected only by your Forum peers, not from our Team. That’s pointed out on our website.

    Every initialization object should be bound to one widget.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.