jQuery UI Widgets Forums Grid why after update row the scroll position has goes to default values?

This topic contains 1 reply, has 2 voices, and was last updated by  Stanislav 3 years, 3 months ago.

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

  • Zabelsky
    Participant

    Hello!
    Why after update row the scroll position has goes to default values i.e. top = 0 ;left = 0 ?
    I working with angularJs
    after

     $scope.$on("dbChange" + Enum.DbChangingItem.Order.description, function(e, args) {
                var changeType = getEnumByValue(Enum.DbChangeType, args.changeType);
                var id = args.id;
                updateGrid(id);
            });
    
    function updateGrid(id) {
                var entities = deepIdSearch(id);
                var ids = [];
                for (var i = 0; i < entities.length; i++) {
                    ids.push(entities[i].TractorId);
                }
                if (ids.length > 0) {
                    dataService.disposition_getByIds(ids).then(function(response) {
                        for (var i = 0; i < response.length; i++) {
                            var d = $scope.settings.source._source.localdata;
                            var value = entities[i];
                            var index = d.indexOf(value);
                            var id = $scope.settings.jqxGrid('getrowid', index);
                            $scope.settings.jqxGrid('updaterow', id, createRow(response[i]));
                    });
                }
            } 

    Update method has been successed,but after $scope.$on will end
    scroll position go to default value
    What`s happenned?
    i need ur help
    thx


    Stanislav
    Participant

    Hello AlexeyZabelsky,

    When you updateGrid you refresh it in a way, because of that, the scrollbar resets its self.
    You can get its current position and reset it when the grid loads again.

    1) Scrollbar position – you can get the position of the scrollbar.
    2) Scrollbar offset – you can set the offset of the scrollbar

    Best Regards,
    Stanislav

    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.