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

时间:2012-12-29 08:08:10

标签: blackberry-10 blackberry-cascades

我在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
                }
            }
        }
    }
]

1 个答案:

答案 0 :(得分:1)

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

onTriggered: {
                        if(indexPath!=0){
                        var selectedItem = dataModel.data(indexPath);
                        var newPage = nextPage.createObject();
                        navigationPane.push(newPage);
                    }