1. #1
    Sencha User
    Join Date
    Mar 2008
    Posts
    50
    Vote Rating
    0
    reminder is on a distinguished road

      0  

    Default List store help

    List store help


    hello

    i tried in every possible way this combination but it still wont work...
    the data is loaded, i can see it into the console but not on the list...
    Code:
    //returned json
    
    {"items":[{"threadid":1000187,"group_name":"<img src='imgs/cgroup.gif' width='16' height='16' border='0'> ALFA NET"}, {"threadid":1000149,"group_name":"<img src='imgs/cgroup.gif' width='16' height='16' border='0'> ARMUS D.O.O."}]}
    
    ................................................................
    
             Ext.regModel('group_list', {
                idProperty: "threadid", fields: ["group_name"]
             });
    
    .........................................
    
             tpl: '<tpl for="."><div class="groups"><strong>{group_name}</strong></div></tpl>',
             store: new Ext.data.Store({
                        autoLoad: true,
                        storeId: "vehicle_groups_store",
                        model: "group_list",
                        proxy: new Ext.data.HttpProxy({
                            url: "get_groups.php",
                            reader: {
                                    root: "items"
                            }
                        })
                }),
    any help appreciated...

    thanx in advance..

  2. #2
    Sencha User
    Join Date
    Nov 2007
    Posts
    294
    Vote Rating
    0
    Sesshomurai is on a distinguished road

      0  

    Default


    Quote Originally Posted by reminder View Post
    hello

    i tried in every possible way this combination but it still wont work...
    the data is loaded, i can see it into the console but not on the list...
    Code:
    //returned json
    
    {"items":[{"threadid":1000187,"group_name":"<img src='imgs/cgroup.gif' width='16' height='16' border='0'> ALFA NET"}, {"threadid":1000149,"group_name":"<img src='imgs/cgroup.gif' width='16' height='16' border='0'> ARMUS D.O.O."}]}
    
    ................................................................
    
             Ext.regModel('group_list', {
                idProperty: "threadid", fields: ["group_name"]
             });
    
    .........................................
    
             tpl: '<tpl for="."><div class="groups"><strong>{group_name}</strong></div></tpl>',
             store: new Ext.data.Store({
                        autoLoad: true,
                        storeId: "vehicle_groups_store",
                        model: "group_list",
                        proxy: new Ext.data.HttpProxy({
                            url: "get_groups.php",
                            reader: {
                                    root: "items"
                            }
                        })
                }),
    any help appreciated...

    thanx in advance..
    Don't you have to specify the reader type 'json'?

  3. #3
    Sencha User
    Join Date
    Mar 2008
    Posts
    50
    Vote Rating
    0
    reminder is on a distinguished road

      0  

    Default


    yes!!! thank you very much! so tired today
    regards

  4. #4
    Ext User
    Join Date
    Nov 2009
    Posts
    24
    Vote Rating
    0
    epalm is on a distinguished road

      0  

    Default


    I might be having a similar (or nearby) problem. I'm really struggling with the lack of consistent documentation.

    Data returned (by solr):
    Code:
    {
     "responseHeader":{
      "status":0,
      "QTime":0,
      "params":{
    	"raw":"true",
    	"fl":"doc-id,common-id,Title,Contributors",
    	"indent":"on",
    	"start":"0",
    	"q":"Title:Java",
    	"wt":"json",
    	"rows":"4"}},
     "response":{"numFound":59,"start":0,"docs":[
    	{
    	 "doc-id":"58900",
    	 "common-id":"/ebooks/oca1/26/javahead00herguoft",
    	 "Title":"Java Head",
    	 "Contributors":"Hergesheimer, Joseph"},
    	{
    	 "Contributors":"Rischpater, Ray",
    	 "Title":"Beginning Java ME platform",
    	 "common-id":"/ebooks/ebooks0/springer/2010-02-11/2/9781430210627",
    	 "doc-id":"260661"},
    	{
    	 "Contributors":"Zukowski, John",
    	 "Title":"Java 6 platform revealed",
    	 "common-id":"/ebooks/ebooks0/springer/2009-12-01/4/9781430201878",
    	 "doc-id":"265847"},
    	{
    	 "Contributors":"Wood, Jo",
    	 "Title":"Java programming for spatial sciences",
    	 "common-id":"/ebooks/ebooks0/tf/2010-04-28/1/0203166175",
    	 "doc-id":"252882"}
    }}
    As you can see, the root is thedata.response.docs, total results is thedata.response.numFound and identifying field is doc-id.

    My code:
    Code:
    Ext.regModel('Document', {
        fields: ['doc-id', 'common-id', 'Title', 'Contributors']
    });
    
    var store = new Ext.data.Store({
        autoLoad: true,
        model: 'Document',
        proxy: new Ext.data.HttpProxy({
            method: 'get',
            url: 'http://books2.scholarsportal.info/SolrRequest',
            reader: new Ext.data.JsonReader({
                idProperty: 'doc-id',
                root: 'response.docs'
            }),
            baseParams: {
                wt: 'json',
                raw: 'true',
                fl: 'doc-id,common-id,Title,Contributors',
                start: '0',
                rows: '10',
                q: 'Title:Java'
            }
        })
    });
    And I get the error this.model is undefined.

    I'm autoLoading for now, but I assume once this is working I'll be able to to remove the q from baseParams and do store.load({ params: { q: 'Title:Java' } }); ?

    Thanks!

    Edit: Forgot two things.

    Comment: the Ext.List loads and works great with local data, ie using data: [ ... ] in the store.

    Question: after store.load(...) will the Ext.List be populated with the store's new data, or do I need to refresh it somehow?

  5. #5
    Sencha User
    Join Date
    Mar 2007
    Location
    Haarlem, Netherlands
    Posts
    1,243
    Vote Rating
    10
    TommyMaintz will become famous soon enough TommyMaintz will become famous soon enough

      0  

    Default


    It should be populated with the stores new data automatically.

  6. #6
    Ext User
    Join Date
    Nov 2009
    Posts
    24
    Vote Rating
    0
    epalm is on a distinguished road

      0  

    Default


    Ok cool.

    Any wisdom about the error?

  7. #7
    Sencha User
    Join Date
    Nov 2007
    Posts
    294
    Vote Rating
    0
    Sesshomurai is on a distinguished road

      0  

    Default


    Here is my json store list hacked from the kiva example.

    Code:
    SearchList = Ext.extend(Ext.List, {
        title: 'Search',
    
        itemSelector: 'div.document',
        singleSelect: true,
        emptyText: 'No results matching that query.',
    
        isLoaded: false,
        
        initComponent : function() {
    
            Ext.regModel('Search', {
                fields: ['title']
            });
            this.store = new Ext.data.Store({model: 'Search'});
    
            this.tpl = new Ext.XTemplate.from('search', {compiled: true});
    
            this.on('selectionchange', function(e, row, rowdata){
                this.dataPopup = new LoanInfo({
                    data: rowdata[0],
                    listeners: {
                        hide: function(){
                            this.clearSelections(true);
                        },
                        scope: this
                    }
                });
                this.dataPopup.show();
            });
    
            SearchList.superclass.initComponent.call(this);
        },
    
        filterResults : function(filterBar, values) {
            var data = Ext.applyIf(values || {}, {
                gender: null,
                region: null,
                sector: null,
                sort_by: null,
                q: null
            });
    
            if (data.q) {
                // reset filters
            }
    
            setTimeout(function(){
                if (!this.isLoaded) {
                    //Ext.getBody().mask(false, '<div class="loading">Loading&hellip;</div>');
                }
            }, 1);
    
            this.isLoaded = false;
            Ext.Ajax.request({
                url: 'http://localhost:8080/symphony/touch/src/data.json',
                scope:this,
                failure: function() {
                    alert("failure");
                },
                success: function(response, opts) {
                    //Ext.getBody().unmask();
                    this.isLoaded = true;
                    var docs = Ext.decode(response.responseText);
                    this.update('');
    
                    var row, i, ln;
                    if (docs) {
                        
                        for (i = 0, ln = docs.documents.length; i < ln; i++) {
                            row = docs.documents[i];
    
                        }
    
    
                        this.store.loadData(docs.documents);
                        this.scroller.scrollTo({x: 0, y: 0}, true);
                }
                }
            });
        }
    });
    and the template in the HTML

    Code:
            <textarea class="x-hidden-display" id="search">
            <tpl for=".">
                <div class="document">
                    <h1>{title}</h1>
                    <div style="font-size: 10px">{author}</div>
                </div>
            </tpl>
        </textarea>
    hth

  8. #8
    Sencha User
    Join Date
    Mar 2008
    Posts
    50
    Vote Rating
    0
    reminder is on a distinguished road

      0  

    Default


    try
    Code:
    reader: {
                 type: 'json',
                idProperty: 'doc-id',
                root: 'response.docs'
            },
    regards

  9. #9
    Ext User
    Join Date
    Nov 2009
    Posts
    24
    Vote Rating
    0
    epalm is on a distinguished road

      0  

    Default


    The reader is already an Ext.data.JsonReader. Tried it though, getting the same error ("this.model is undefined").

Similar Threads

  1. Two Ext.list.ListView using the same store
    By eztam in forum Ext 3.x: Help & Discussion
    Replies: 4
    Last Post: 26 Oct 2011, 12:54 AM
  2. Problem with List and JSON Store
    By tubamanu in forum Sencha Touch 1.x: Discussion
    Replies: 10
    Last Post: 6 Jul 2010, 1:37 PM
  3. ComboBox store and refresh list
    By sunco in forum Ext 3.x: Help & Discussion
    Replies: 4
    Last Post: 25 Feb 2010, 1:53 PM
  4. list after store loading
    By xiankai in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 7 Dec 2007, 6:46 AM

Thread Participants: 3

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