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 3ca1398 need ICollectionView support for selected item in ADG. Fixes
#442
3ca1398 is described below
commit 3ca13983e3a0cf293ba00ed112240a8bc3a3dc58
Author: Alex Harui <[email protected]>
AuthorDate: Mon Aug 12 21:31:14 2019 -0700
need ICollectionView support for selected item in ADG. Fixes #442
---
.../MXRoyale/src/main/resources/defaults.css | 2 +-
.../MXRoyale/src/main/royale/MXRoyaleClasses.as | 1 +
.../beads/models/DataGridICollectionViewModel.as | 100 +++++++++++++++++++++
3 files changed, 102 insertions(+), 1 deletion(-)
diff --git a/frameworks/projects/MXRoyale/src/main/resources/defaults.css
b/frameworks/projects/MXRoyale/src/main/resources/defaults.css
index df73449..bc5834c 100644
--- a/frameworks/projects/MXRoyale/src/main/resources/defaults.css
+++ b/frameworks/projects/MXRoyale/src/main/resources/defaults.css
@@ -80,7 +80,7 @@ AdvancedDataGrid
IChangePropagator:
ClassReference("org.apache.royale.html.beads.DataGridColumnChangePropagator");
IDataGridPresentationModel:
ClassReference("org.apache.royale.html.beads.models.DataGridPresentationModel");
IBeadView: ClassReference("mx.controls.beads.DataGridView");
- IBeadModel:
ClassReference("org.apache.royale.html.beads.models.DataGridModel");
+ IBeadModel:
ClassReference("mx.controls.beads.models.DataGridICollectionViewModel");
IBeadLayout:
ClassReference("org.apache.royale.html.beads.layouts.DataGridLayout");
columnClass:
ClassReference("mx.controls.advancedDataGridClasses.AdvancedDataGridColumnList");
diff --git a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
index 2ae8d66..f720981 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
@@ -235,6 +235,7 @@ internal class MXRoyaleClasses
import mx.controls.beads.models.ComboBoxModel; ComboBoxModel;
import mx.controls.beads.models.SingleSelectionICollectionViewModel;
SingleSelectionICollectionViewModel;
+ import mx.controls.beads.models.DataGridICollectionViewModel;
DataGridICollectionViewModel;
import mx.controls.beads.models.SingleSelectionIListModel;
SingleSelectionIListModel;
import mx.controls.buttonBarClasses.TextButtonDataGridColumnItemRenderer;
TextButtonDataGridColumnItemRenderer;
diff --git
a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/models/DataGridICollectionViewModel.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/models/DataGridICollectionViewModel.as
new file mode 100644
index 0000000..7ab5b31
--- /dev/null
+++
b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/models/DataGridICollectionViewModel.as
@@ -0,0 +1,100 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package mx.controls.beads.models
+{
+ import org.apache.royale.core.IUIBase;
+ import org.apache.royale.events.Event;
+ import org.apache.royale.core.IBeadModel;
+ import org.apache.royale.core.IDataGridModel;
+
+ /**
+ * MenuBar Mouse Controller
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.0
+ */
+ public class DataGridICollectionViewModel extends
SingleSelectionICollectionViewModel implements IDataGridModel
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.0
+ */
+ public function DataGridICollectionViewModel()
+ {
+ }
+
+ private var _columns:Array;
+
+ /**
+ * The array of org.apache.royale.html.supportClasses.DataGridColumns
used to
+ * define each column of the org.apache.royale.html.DataGrid.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.0
+ */
+ public function get columns():Array
+ {
+ return _columns;
+ }
+ public function set columns(value:Array):void
+ {
+ if (_columns != value) {
+ _columns = value;
+ dispatchEvent( new Event("columnsChanged"));
+ }
+ }
+
+ private var _headerModel:IBeadModel;
+
+ /**
+ * The model to use for the DataGrid's header.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.9
+ */
+ public function get headerModel():IBeadModel
+ {
+ return _headerModel;
+ }
+ public function set headerModel(value:IBeadModel):void
+ {
+ if (_headerModel != value) {
+ _headerModel = value;
+ dispatchEvent(new Event("headerModelChanged"));
+
+ _headerModel.addEventListener("dataProviderChanged",
handleHeaderModelChange);
+ }
+ }
+
+ private function handleHeaderModelChange(event:Event):void
+ {
+ dispatchEvent(new Event("headerModelChanged"));
+ }
+ }
+}