1. #11
    Sencha User
    Join Date
    Aug 2010
    Location
    Europa
    Posts
    216
    Vote Rating
    1
    kortovos is on a distinguished road

      0  

    Default


    Quote Originally Posted by kortovos View Post
    Oke, I made sure that the server returns text/xml, by adding 'header("Content-Type: text/xml");' to the php document. So now I don't get any errors, but the store still doesn't get filled.
    Nevermind, I was a bit to enthousiastic with my function. I didn't wait for the response before counting the records in the store.
    It functions fine.

  2. #12
    Sencha User
    Join Date
    Aug 2010
    Location
    Europa
    Posts
    216
    Vote Rating
    1
    kortovos is on a distinguished road

      0  

    Default


    Quote Originally Posted by steve1964 View Post
    How you check if the store is filled?
    With a getCount(), but I didn't wait for the response. It is working fine now.

  3. #13
    Sencha User
    Join Date
    Aug 2010
    Location
    Europa
    Posts
    216
    Vote Rating
    1
    kortovos is on a distinguished road

      0  

    Default


    Another question. Is it possible to instruct the app to wait until the store is finished with loading? I have tried with a listener (datachanged) but for some reason it won't fire after the store has completed its read.

  4. #14
    Sencha User
    Join Date
    Aug 2010
    Location
    Europa
    Posts
    216
    Vote Rating
    1
    kortovos is on a distinguished road

      0  

    Default


    Quote Originally Posted by kortovos View Post
    Another question. Is it possible to instruct the app to wait until the store is finished with loading? I have tried with a listener (datachanged) but for some reason it won't fire after the store has completed its read.
    Nevermind, already found the problem

  5. #15
    Sencha User
    Join Date
    Jan 2011
    Posts
    9
    Vote Rating
    0
    ickyfoot is on a distinguished road

      0  

    Default Hi There

    Hi There


    This is my first post on the Sencha forums. Let me start by saying, Sencha Touch is amazing! It's my first time using ExtJs, and while there's a bit of a learning curve, it really is incredible once you start to understand it.

    Anyway, the reason I am posting in this thread is because I'm trying desperately to use a mysql-populated Store to generate the items in a form's selectfield. I can make this work if I use inline Store data, but just can't seem to populate the Store from a php file. Here is the client-side code:

    Code:
    Ext.apply(Ext.data.AjaxProxy.prototype.actionMethods, {
        read: 'POST'
    });
    		
    Ext.regModel('listName', {
        fields: [
            {name: 'name', type: 'string'}                
        ]
    });
    		
    var store = new Ext.data.Store({
    model: 'listName',
    proxy: {
        type: 'ajax',
        method: 'post',
        url : 'serverside/listContent.php',
        params: {action: 'gtLstNms'},
        reader: {
            type: 'json',
            root: ''
        }
    },
    autoLoad: true
    });
    And, the php:

    PHP Code:
    $result mysql_query("SELECT name FROM table");
        while(
    $obj mysql_fetch_object($result)) {
            
    $arr[] = $obj;
        }
    echo 
    json_encode($arr); 
    As you can see, this is quite simple from a data/content perspective.

    Anyway, when I access the form and click on the select field I get "cannot read property 'id' of undefined.'

    Edit: Oh yeah, when I use a simple Ext.Ajax.request and console.log the the response from the same php content as above, I get [{"name":"Test"}], which is what I'd expect (just one entry in the db for now). Unfortunately, I'm not aware of how to check what, if anything, I'm getting back from the Store's ajax proxy.

    Any help is much appreciated. My apologies for resurrecting this old-ish thread and/or hijacking it, but this seems moderately related, and not worth its own space.

    Many thanks!

    -Eric

  6. #16
    Sencha User
    Join Date
    Jan 2011
    Posts
    9
    Vote Rating
    0
    ickyfoot is on a distinguished road

      0  

    Default


    Heh, I'm realizing the problem may simply be that the server hasn't populated the Store before the form finishes rendering. Now I have to figure out how to handle that issue. Hopefully I haven't just wasted space here, but it looks like maybe I have .

  7. #17
    Sencha User
    Join Date
    Jan 2011
    Posts
    9
    Vote Rating
    0
    ickyfoot is on a distinguished road

      0  

    Default


    Ugh! It was simply because I was using "params" instead of "extraParams" in my proxy! Sincere apologies for cluttering everything up and bumping such an old thread over such a simple issue.

  8. #18
    Sencha User
    Join Date
    Apr 2012
    Posts
    3
    Vote Rating
    0
    codehtmai is on a distinguished road

      0  

    Default


    Quote Originally Posted by ickyfoot View Post
    Ugh! It was simply because I was using "params" instead of "extraParams" in my proxy! Sincere apologies for cluttering everything up and bumping such an old thread over such a simple issue.
    Ickyfoot, you saved the day. extraParams did it for me, I just couldn't find where to set that.

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. Replies: 2
    Last Post: 29 Jun 2010, 2:46 PM
  4. Problem with proxy ajax call
    By mysticav in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 4 Dec 2008, 12:10 PM
  5. 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

Thread Participants: 4

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar