在黑莓10级联中阻止listview标题上的onTriggered事件?

问题描述 投票:0回答:1

我在listview blackberry 10 qml中创建了自定义标题。但是listview标题也在OnTriggered事件上触发。

listItemComponents: [
    ListItemComponent {
    type: "header"
        Container {
            preferredWidth: 748
            layout: DockLayout {}

            Label {
                text: "Custom Header"
                horizontalAlignment: HorizontalAlignment.Left
                verticalAlignment: VerticalAlignment.Center
                textStyle{
                    base:SystemDefaults.TextStyles.BigText
                }
            }
        }
    }
]
blackberry-10 blackberry-cascades
1个回答
1
投票

最后我找到了答案,实现了listview ontriggered函数,如下所示

onTriggered: {
                        if(indexPath!=0){
                        var selectedItem = dataModel.data(indexPath);
                        var newPage = nextPage.createObject();
                        navigationPane.push(newPage);
                    }
© www.soinside.com 2019 - 2024. All rights reserved.