I have ListVIew that is filled with hard-coded DataModel. Then I want to create DropDown menu that contains the dataModel header.
When I select the DropDown option, I want ListView to only show the items for the selected header.
So, my questions are:
-
How can I do this in
QML? -
Is there any way to populate the
DropDown'sOptionwith the data model?
Below is my application’s structure:
Page{
Container{
DropDown{} //onSelectedValueChanged, I want the ListView filtered
ListView{
dataModel: XmlDataModel{...}
listItemComponents: [...]
}
}
}
Thanks before
I asked the question in Blackberry support forum and got the answer:
If we follow the documentation, we know that dataModel looks like this:
Then we change the
rootIndexPathto the index of the header. So only the child of that header is shown. The index is in array integer type