Results 1 to 4 of 4

Thread: Auto fill json store fields for loading a grid

  1. #1

    Default Auto fill json store fields for loading a grid

    I would like to be able to populate my grid with different info from the json store without defining the fields first (Having the fields defined dynamically) so I can re-use the same grid extension for a lot of similar data from different tables in the db.

    I looked at this thread and it looked very applicable but I don't know how to apply it to a grid store or if I am following it correctly.

    http://extjs.com/forum/showthread.php?t=18361

    Code:
    jnms.data.manageStore =  new Ext.data.JsonStore({
    	    url:  '/cgi/admin/load_grid.cgi',
    	    root: 'info',
    	    fields: [ ]
    });

  2. #2

    Default

    Oops, meant this for Ext 2.0 help.....but it probably is applicable to both.

  3. #3

    Default

    Hi josh,

    I have exactly the same puzzle to solve Have you found the solution maybe?

  4. #4

    Default

    Yes, you need to return your json with the metaData values defined by your server. This will allow you to map your fields dynamically without having to configure them in advance.

    Take a look at the docs for Json Reader: http://www.sencha.com/deploy/dev/docs/

    You will see an area where they talk about "Automatic Configuration"

Posting Permissions

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