extjs4 - Extjs Get Id from database and pass it to component -


problem facing is. have form query database , information on cars, unique id of data , pass made component.

 layout : 'fit',  items : [{        xtype: 'cargrid',        autoscroll: true        //here want id passed cone  }] 

maybe, did u want show id of row on grid ?

  1. you need on store/model. define 1 'id' field on data store.

model:

fields: [              {name: 'idrow'},              {...} ] 
  1. on grid, define 1 column, same name of "store field id" on dataindex:

grid view:

columns: [{         header: "identificator",         dataindex: 'idrow'     },         {...}  ] 

edit:

if want overwrite de id:

see link belong: itemid

and in comment: (copy&paste)

example:

var c = new ext.panel.panel({ //     height: 300,     renderto: document.body,     layout: 'auto',     items: [         {             itemid: 'p1',             title: 'panel 1',             height: 150         },         {             itemid: 'p2',             title: 'panel 2',             height: 150         }     ] }) p1 = c.getcomponent('p1'); // not same ext.getcmp() p2 = p1.ownerct.getcomponent('p2'); // reference via sibling 

comment:

    ext.apply(c, {         itemid : 'p3'     } 

Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

php - Dynamic url re-writing using htaccess -

java - Multi-Label Document Classification -