Is there a way to hide/show items in the Ext.dataview.List through the datastore it's hooked up to?
Here's the relevant code,
Code:
Ext.define('app.model.channeltopackage.Channel', {
extend: 'Ext.data.Model',
config: {
fields:["id", "name","hidden"]
}
});
Code:
Ext.define('app.store.channeltopackage.Channels', {
extend:'Ext.data.Store',
config:{
model:'app.model.channeltopackage.Channel',
data:{
results:[]
},
proxy:{
type:'memory',
reader:{
type:'json',
rootProperty:'results'
}
}
}
});
Code:
Ext.define('app.view.channeltopackage.ResultList', {
extend:'Ext.dataview.List',
alias:['widget.channeltopackageresultlist'],
config:{
itemTpl:[
"{name}"
].join(''),
store:'Channels'
},
constructor:function (config) {
this.callParent(arguments); // calls Ext.panel.Panel's constructor
}
});
I want to add a hidden attribute so it doesn't show up in the list right away. Like this,
Code:
Ext.StoreManager.get("Channels").addData({name:"ABC",hidden:true,id:"abc"});
Later I want to iterate over all the channels and show/hide them.
Code:
Ext.StoreManager.get("Channels").each(function(channel) {
if (?) {
channel.set("hidden",true)
}
}, this);
Thanks for the help!