我有一个带有复选框的列表视图。我想在列表视图中获取所选项目的值。我怎样才能实现上述..?
我已经发布了下面的截图:
这是我尝试过的:
// 列表视图声明及其元素:
ListView {
verticalAlignment: VerticalAlignment.Center
horizontalAlignment: HorizontalAlignment.Center
layout: FlowListLayout {
}
dataModel: grouplistdatamodel
listItemComponents: [
ListItemComponent {
type: "item"
Container {
Container {
layout: StackLayout {
orientation: LayoutOrientation.TopToBottom
}
verticalAlignment: VerticalAlignment.Center
horizontalAlignment: HorizontalAlignment.Center
preferredWidth: 768
Container {
verticalAlignment: VerticalAlignment.Center
layout: StackLayout {
orientation: LayoutOrientation.LeftToRight
}
CheckBox {
verticalAlignment: VerticalAlignment.Center
id:checkboxvalues
text: ListItemData.firstname
onCheckedChanged: {
}
}
}
}
Divider {
horizontalAlignment: HorizontalAlignment.Fill
}
}
}
]
onTriggered: {
_test.showToast(userid);
}
onCreationCompleted: {
group_DataSource.load();
}
}
请帮我解决这个问题。提前致谢..!