Results 1 to 3 of 3

Thread: How to use sencha touch traversal store?

  1. #1
    Sencha User
    Join Date
    Sep 2010
    Posts
    40

    Question How to use sencha touch traversal store?

    How to use sencha touch traversal store?
    Tried several times, but not succeed.
    Someone wants to tell me? thank you
    Code:
    Ext.regModel('user', {
                fields: ['name','password'],
                proxy: {
                    type: 'ajax',
                    url : 'jsp/items.jsp'
                }
            });
            var store = new Ext.data.Store({
                model: 'user',
                autoLoad: true
            });
            store.each('user',function(record) {
                Ext.Msg.alert('Info',record.get('name'));
            });

  2. #2
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    Code:
    xt.regModel('user', {
                fields: ['name','password'],
                proxy: {
                    type: 'ajax',
                    url : 'jsp/items.jsp'
                }
            });
            var store = new Ext.data.Store({
                model: 'user',
                autoLoad: true, 
                listeners : {
                    load : function() {
                      store.data.each(function(record) {
                               console.info(record.get('name'));
                     });
                    }
                }
            });
    Your problems:
    1) You are trying to access data from the store before it has actually finished the round trip.
    2) Don't do a Msg.alert on multiple items. You'll only see the last.
    3) *do* use an event listener, such as load to manipulate your store after it has been loaded.

  3. #3
    Sencha User
    Join Date
    Sep 2010
    Posts
    40

    Default

    thank you very much!
    expect sench touch in action

Similar Threads

  1. Replies: 10
    Last Post: 20 Jan 2012, 10:10 AM
  2. Waiting for Store in Sencha Touch
    By gocsp11 in forum Sencha Touch 1.x: Discussion
    Replies: 0
    Last Post: 31 Jan 2011, 9:13 AM
  3. Sencha Touch and long list/store performance
    By bklaas in forum Sencha Touch 1.x: Discussion
    Replies: 3
    Last Post: 20 Dec 2010, 10:41 AM
  4. Does Sencha Touch allow us to do adding and deleting in the data store?
    By jedihua in forum Sencha Touch 1.x: Discussion
    Replies: 2
    Last Post: 13 Oct 2010, 2:16 PM
  5. sencha touch list store problem
    By reminder in forum Sencha Touch 1.x: Discussion
    Replies: 1
    Last Post: 27 Jun 2010, 11:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •