Is there any other way rather than hacking ng-grid.js file?
On Friday, April 18, 2014 1:12:34 AM UTC+12, Mizanur Rahman Khan wrote:
>
> your hitted on the right point, but the hack will not work in all case, it
> will just work on first update.
> $scope.adjustScrollTop() function first checks if the position of
> scrolltop is changed. if false it will not render new rows.
> see the inner code of that function:
>
> $scope.adjustScrollTop = function(scrollTop, force) {
> if (self.prevScrollTop === scrollTop && !force) {
> return;
> }
> ...
> ...
> if you replace "scrollTop" with a static value such as 10, so:
>
> $scope.adjustScrollTop(10);
>
> on first call it will see the scrolltop is changed from 0 to 10, and
> render new rows. but from later on it will not work since scrolltop's old
> value and new value both are 10 now.
>
> the easy and proper hack will be to call this function with optional param
> 'force' to true.
> like this:
> $scope.adjustScrollTop(scrollTop,true);
>
> then always it will render new rows and should serve the purpose
> thanks
> -Mizan
>
>
>
> On Friday, April 12, 2013 4:38:40 PM UTC+6, Leon Revill wrote:
>>
>> I have found a dirty "hack" which appears to solve the issue, however it
>> is not very flexible.
>>
>> On line 2745 of ng-grid.js there is the following:
>>
>> $scope.adjustScrollTop(scrollTop);
>>
>> scrollTop is the top position of the scrollbar, as the jQuery custom
>> scroll bar plugins do not use the actual scoll bar this will remain at 0.
>>
>> The dirty fix is to just replace "scrollTop" with a static value such as
>> 10, so:
>>
>> $scope.adjustScrollTop(10);
>>
>> Which then increases the position by 10 each time, this is working with
>> the scrollPane plugin.
>>
>> I hope someone can come up with a better solution that this! I have tried
>> moving the original scroll bar based on events fired by the scroll bar
>> plugin but to no avail.
>>
>> Bets of luck!
>>
>> Leon.
>>
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.