1. #1
    Sencha User
    Join Date
    Feb 2011
    Posts
    111
    Answers
    5
    Vote Rating
    0
    sissonb is on a distinguished road

      0  

    Default Answered: Hiding List Items through the Store

    Answered: Hiding List Items through the Store


    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!

  2. store.filter

  3. #2
    Sencha User
    Join Date
    Apr 2010
    Location
    China
    Posts
    227
    Answers
    64
    Vote Rating
    20
    haduki will become famous soon enough haduki will become famous soon enough

      1  

    Default


    store.filter
    I write English by translator.

  4. #3
    Sencha User
    Join Date
    Feb 2011
    Posts
    111
    Answers
    5
    Vote Rating
    0
    sissonb is on a distinguished road

      0  

    Default


    Thanks, I added this code to my store's config,

    Code:
            filters:[
                new Ext.util.Filter({
                    filterFn: function(item) {
                        return !item.get("hidden");
                    }
                })
            ],

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi