【问题标题】:How to get all the row indices when I select datagrid rows using shift key?使用 shift 键选择数据网格行时如何获取所有行索引?
【发布时间】:2013-09-02 09:37:39
【问题描述】:

如何使用 shift 键收集我在 spark 数据网格中选择的所有行索引,并且我想将它们收集到 arraycollection 中。

【问题讨论】:

    标签: actionscript-3 flash apache-flex actionscript datagrid


    【解决方案1】:
    var yourAC : ArrayCollection = new ArrayCollection();
    for each (var elem:Object in yourDataGrid.selectedIndices) {
        yourAC.addItem(elem);
    }
    

    【讨论】:

      【解决方案2】:

      使用selectedIndices 属性。它会给出一个Vector;这就像一个类型化数组。如果你真的需要一个 ArrayCollection,你可以编写一个转换例程。如果您使用的是 Apache Flex,还可以使用 VectorCollection 类。

      【讨论】:

        猜你喜欢
        • 2019-04-22
        • 1970-01-01
        • 2012-11-14
        • 1970-01-01
        • 1970-01-01
        • 2020-07-16
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多