You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2020/02/22 08:05:25 UTC
[royale-asjs] branch develop updated: implement scrollToIndex for
ADG
This is an automated email from the ASF dual-hosted git repository.
aharui pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/develop by this push:
new 4fddc55 implement scrollToIndex for ADG
4fddc55 is described below
commit 4fddc558753a97f5ddf5dd3d9f7716e1c5da03f0
Author: Alex Harui <ah...@apache.org>
AuthorDate: Sat Feb 22 00:05:13 2020 -0800
implement scrollToIndex for ADG
---
.../royale/mx/controls/listClasses/AdvancedListBase.as | 14 ++++++++++++--
.../src/main/royale/mx/controls/listClasses/ListBase.as | 3 ++-
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/AdvancedListBase.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/AdvancedListBase.as
index df291af..1c8f373 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/AdvancedListBase.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/AdvancedListBase.as
@@ -5873,8 +5873,10 @@ public class AdvancedListBase extends ListBase /* extends UIComponent
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Royale 0.9.4
- public function scrollToIndex(index:int):Boolean
+ */
+ override public function scrollToIndex(index:int):Boolean
{
+ /*
var newVPos:int;
if (index >= verticalScrollPosition + listItems.length - lockedRowCount - offscreenExtraRowsBottom || index < verticalScrollPosition)
@@ -5883,9 +5885,17 @@ public class AdvancedListBase extends ListBase /* extends UIComponent
verticalScrollPosition = newVPos;
return true;
}
+ */
+ COMPILE::JS
+ {
+ var listArea:IUIBase = (view as AdvancedDataGridView).listArea;
+ var element:HTMLElement = listArea.element;
+ var max:Number = Math.max(0, dataProvider.length * rowHeight - element.clientHeight);
+ var yy:Number = Math.min(index * rowHeight, max);
+ element.scrollTop = yy;
+ }
return false;
}
- */
/**
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/ListBase.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/ListBase.as
index ef9b9b0..12dd221 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/ListBase.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/ListBase.as
@@ -799,10 +799,11 @@ use namespace mx_internal;
return _strandChildren;
}
- public function scrollToIndex(index:int):void
+ public function scrollToIndex(index:int):Boolean
{
trace("ListBase:scrollToIndex not implemented");
+ return false;
}
/**