1. #1
    Sencha User
    Join Date
    Oct 2012
    Location
    Toulouse
    Posts
    58
    Answers
    7
    Vote Rating
    0
    novadys-sbu is on a distinguished road

      0  

    Default Answered: Render foreach item of store

    Answered: Render foreach item of store


    Hi everyone,

    I come to you with yet another problem I have with my sencha touch app.

    I am currently using Ext.ux.touch.grid.List (thanks Mitchel Simeons by the way ) and am able to render my data in it like so :
    Code:
    config: {                                          store    : true,
            scrollable: {
                direction: 'horizontal',
                directionLock: true
            },
            columns  : [
                {
                    header    : 'Id',
                    dataIndex : 'id',   
                    width     : '10%',
                    editor    : {
                        xtype  : 'textfield'
                    }
                },
                {
                    header    : 'Host',
                    dataIndex : 'Host',   
                    width     : '10%',
                    editor    : {
                        xtype  : 'textfield'
                    }
                },
                {
                    header    : 'Path',
                    dataIndex : 'Path',   
                    width     : '10%',
                    editor    : {
                        xtype  : 'textfield'
                    }
                },
                {
                    header    : 'SourceHost',
                    dataIndex : 'SourceHost',   
                    width     : '10%',
                    editor    : {
                        xtype  : 'textfield'
                    }
                },
                {
                    header    : 'SourcePath',
                    dataIndex : 'SourcePath', 
                    width     : '10%',
                    editor    : {
                        xtype  : 'textfield'
                    }
                },
                {
                    header    : 'DepotId',
                    dataIndex : 'DepotId',   
                    width     : '10%',
                    editor    : {
                        xtype  : 'textfield'
                    }
                },
                {
                    header    : 'DepotKey',
                    dataIndex : 'DepotKey',  
                    width     : '10%',
                    editor    : {
                        xtype  : 'textfield'
                    }
                },
                {
                    header    : 'Parent',
                    dataIndex : 'Parent',   
                    width     : '10%',
                    editor    : {
                        xtype  : 'textfield'
                    }
                }
    }
    What I would prefer to do is to do a foreach because each dataIndex is an item of my store. Is there anyway of doing this ?

    Thanks for your help

  2. So basically I had to do in my PHP backend and send the json string back. Then use the eval on success.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,118
    Answers
    3504
    Vote Rating
    855
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    So you want to get the fields from the store and build the columns for that?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User
    Join Date
    Oct 2012
    Location
    Toulouse
    Posts
    58
    Answers
    7
    Vote Rating
    0
    novadys-sbu is on a distinguished road

      0  

    Default Basically yes

    Basically yes


    The solution I'm trying is to create my touchgridpanel dynamically with a PHP backend. Not there yet, but will keep you posted

  5. #4
    Sencha User
    Join Date
    Oct 2012
    Location
    Toulouse
    Posts
    58
    Answers
    7
    Vote Rating
    0
    novadys-sbu is on a distinguished road

      0  

    Default Work around

    Work around


    So basically I had to do in my PHP backend and send the json string back. Then use the eval on success.