1. #1
    Sencha User
    Join Date
    Nov 2012
    Posts
    14
    Vote Rating
    0
    pflopez is on a distinguished road

      0  

    Default Unanswered: Filtered store on dataview.list

    Unanswered: Filtered store on dataview.list


    Hi everyone, i'm a bit new on Sencha touch and I'm still learning the ropes.
    I've searched for an answer to my question but haven't found it so here it goes:

    I have a dataview.list + a store (localstorage) .

    I want to apply apply that store to a view, but filtered.
    The list:

    Code:
    Ext.define("App.view.NotesList", {    
        extend: "Ext.dataview.List",
        xtype: "noteslist",
        config: {
            iconCls: 'list',
            title: 'Tasks',
            items: [
              {
                xtype: "titlebar",
                title: 'Tasks',
                docked: "top",
                items: [
                  {
                    text: 'New',
                    ui: 'action',
                    handler: this.onNewButtonTap,
                    scope: this,
                    align: "right"
                  }
                ] 
              }
            ],
            loadingText: "Loading Tasks...",
            emptyText: '<div class="notes-list-empty-text">No tasks found.</div>',
            onItemDisclosure: false,
            store: "Tasks",
            grouped: true,
            itemTpl: '<div class="list-item-title">{title}</div>'  + 
                 '<div class="list-item-time">{formattedTime}</div>'   +
                 '<div class="list-item-narrative">{description}</div>' 
            ,
        },
         
    });
    And the filter I want to apply:
    Code:
             filters: [
               {
                   property: 'complete',
                   value   : false
               }
             ],
    I' not sure on how to do this, ideally I'll want to define the store there and add the filters, but as I'm only using the reference name, I'm not sure how to accomplish this.

    I also tried having two separate stores, each with filters, but doesn't really apply to what I'm trying to do.

    Thanks in advance!

  2. #2
    Sencha User
    Join Date
    Nov 2012
    Posts
    14
    Vote Rating
    0
    pflopez is on a distinguished road

      0  

    Default


    OK, i was able to do this filtering on the controller, something like this:

    Code:
     launch: function () {
        this.callParent(arguments);
        Ext.getStore("Tasks").load().filter("complete", false);
      }

    Now, my question change a little bit; If I want to add another panel but with same store (with different filter) , how do I reference each panel, so I can load on panel A the filtered with false, and on panel B filtered with true ?

    Should I make another controller?
    Thanks!

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