01-06-2013 12:05 AM
Is it possible to remove an list item in qml triggered from a context action? I have tried to do it in onTriggered signal of the ActionItem of the context actions set but it seems like I can't even access my ListView by its id.
Solved! Go to Solution.
01-06-2013 01:35 AM - edited 01-06-2013 01:36 AM
I had the same problem. In my case, I only care about the depth, so I did this:
onTriggered: {
// item selection handler, write custom code here
console.log("SELECTED path:" + indexPath)
if(indexPath.length > 1) {
//Do something else
} else {
navigationPane.pushLevel(indexPath)
}
}
01-06-2013 01:46 AM
01-06-2013 05:45 AM
Inside a list component should be possible to remove it by
myItemRoot.ListItem.view.dataModel.removeAt( myItemRoot.ListItem.indexPath );
Inside the OnTriggered could be:
listView.dataModel.removeAt( indexPath );