AdvancedDatagrid multipleSelection:是否已选择一行?

发布于 2024-09-04 11:03:22 字数 655 浏览 12 评论 0原文

在高级数据网格中进行多次选择后,我想检查单击的行是否已被选择。无论如何,我下面的想法(在嵌套的 if 子句中,我想检查新单击的项目的处理数据是否已经在添加的数组集合中)不起作用,但我认为必须有更好的方法来区分是否单击了已选择的行。

可能我的描述不够清楚,请提问!

非常感谢,已经提前了, 维尔纳

model.processingData = out; 
if    (model.selectedIndices.length > 1){                   
       //check if item already added
       var tempInt:int = model.multipleProcessingData.getItemIndex(model.processingData);
        if (tempInt == -1){
            model.multipleProcessingData.addItem(model.processingData);
        }

 } else{
       model.multipleProcessingData.removeAll();
       model.multipleProcessingData.addItem(model.processingData);
 }

after multiple Selection in a advanced datagrid, I want to check if the clicked row, was already selected. Anyway my idea below (in the nested if clause I want to check if the newly clicked item's processing data is already in the added Array Collection) is not working, but I assume there must be a better way to differiante if an click was made on a already selected row.

Probably I was not as clear in my description as needed, please ask your questions!

Thank you very much, already in advance,
Werner

model.processingData = out; 
if    (model.selectedIndices.length > 1){                   
       //check if item already added
       var tempInt:int = model.multipleProcessingData.getItemIndex(model.processingData);
        if (tempInt == -1){
            model.multipleProcessingData.addItem(model.processingData);
        }

 } else{
       model.multipleProcessingData.removeAll();
       model.multipleProcessingData.addItem(model.processingData);
 }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

音栖息无 2024-09-11 11:03:22

tssss,ArrayCollection 有一个 contains 函数:

if (!model.selectedDrawings.contains(model.lastSelectedDrawing)){
                        model.selectedDrawings.addItem(model.lastSelectedDrawing);
                    }

tssss, there is a contains function for ArrayCollection:

if (!model.selectedDrawings.contains(model.lastSelectedDrawing)){
                        model.selectedDrawings.addItem(model.lastSelectedDrawing);
                    }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文