1. #1
    Ext User
    Join Date
    Aug 2010
    Posts
    4
    Vote Rating
    0
    dhagan is on a distinguished road

      0  

    Default how to refresh a list using a data store with the ajax proxy without new

    how to refresh a list using a data store with the ajax proxy without new


    Hi Folks,
    I'm cloning the kiva LoanList example and I'm able to load the list from using an Ajax proxy. The rub is that if I want to reload with a new URL, the only way I can figure out to do it is with a new data data store, ie this.store = new Ext.data.store() etc. Unless I'm missing something, I'm not seeing the load() or reload(). I see older references to reload(params{}) but I can't get them to work. Any pointers? Snippet below:

    Code:
      filterResults: function (filterBar, values) {
            //alert("DJH reload offer list here");
    
            function doReefresh(request, success) {
                if (success) {
                    this.refresh();
                } else {
                    alert("Search request failed");
                }
            }
    
            this.store = new Ext.data.Store({
                model: 'Offer',
                sorters: [{
                    field: 'title'
                }],
                proxy: {
                    type: 'ajax',
                    //url: getSearchURL(),
                    url: 'http://localhost/php/sencha/examples/digisearch/list1.json',
                    //url: 'http://dev.jugger.com/digipowers/phone/digisearch/list.json',
                    //url: '/list.json',
                    reader: {
                        type: 'json',
                        root: 'offers'
                    },
                    // DJH question, why is this.refresh() not in scope?
                    //afterRequest: doRefresh(request, success)
                    
                    afterRequest: function (request, success) {
                        if (success) {
                            // this.refresh() is not in scope?
                            //this.refresh();
                        } else {
                            alert("Search request failed");
                        }
                    } 
    
                },
                autoLoad: true,
                listeners: {
                    scope: this,
                    datachanged: function () {
                        alert('4');
                        //DJH this refresh is accessible this.refresh();
                    }
                }
            });
    
            // DJH, this is worthwhile, but being called to early.
            this.refresh();
    
            //        //
            //        // DJH this doesn't work
            //        //
            //        // http://tdg-i.com/325/ext-js-screencast-data-stores-and-gridpanels
            //        this.store.proxy.api.read.url = 'http://localhost/php/sencha/examples//list1.json'
            //        this.store.reload();
            //        // DJH Neither does this
            //        this.store.reload({
            //            model: 'Offer',
            //            sorters: [{
            //                field: 'title'
            //            }],
            //            proxy: {
            //                type: 'ajax',
            //                url: 'http://localhost/php/sencha/examples/list1.json',
            //                reader: {
            //                    type: 'json',
            //                    root: 'offers'
            //                }
            //            },
            //            listeners: {
            //                scope: this,
            //                datachanged: function () {
            //                    alert('4');
            //                }
            //            }
            //        }
            //        );
    
    
        }

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,832
    Vote Rating
    609
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Code:
    store.proxy.url = 'foo';
    store.read();
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Ext User
    Join Date
    Aug 2010
    Posts
    4
    Vote Rating
    0
    dhagan is on a distinguished road

      0  

    Default


    works great! thanks a bunch.

Similar Threads

  1. Ajax.request VS Store proxy
    By merry andrew in forum Sencha Touch 1.x: Discussion
    Replies: 1
    Last Post: 23 Aug 2010, 4:09 PM
  2. Ajax Proxy/Json Store
    By eldiego34 in forum Sencha Touch 1.x: Discussion
    Replies: 2
    Last Post: 19 Aug 2010, 4:59 AM
  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. is data proxy is the same as ajax?
    By ratno in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 24 Nov 2008, 8:35 AM
  5. add id to Store proxy for combo list
    By bhomass in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 21 Oct 2007, 5:57 PM

Thread Participants: 1

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