PDA

View Full Version : How'd I get the store??



Jack Chen
6 Jul 2011, 10:37 PM
Hi, I'm a green. I have a problem. How did I get the store for the Combobox in the 'renderer function' ?

{
header:'    Evaluate',
dataIndex:'evalindextitle',
sortable:true
},{
header:'The Score',
dataIndex:'evalleveldata',
width:80,
fixed:true,
editor: new Ext.form.ComboBox({
id:'statusCmb',
displayField: 'evallevelname',
valueField: 'evallevelGuid',
editable: false,
selectOnFocus: true,
hiddenName: 'evallevelGuid',
hiddenValue: 'evallevelGuid',
mode: 'local',
triggerAction: 'all',
store:new Ext.data.Store({...some text...})
}),
renderer : function(value, cellmeta, record, rowIndex, colIndex, store) { this store is the Store for the ColumnModel
................
}

danguba
7 Jul 2011, 12:23 AM
For Ext 3
You need to have reference to a grid.
Then you can use

grid.colModel.config[colIndex].editor.store

Jack Chen
7 Jul 2011, 12:55 AM
Hi, Thank you very much. You're so cool. And could'd you tell me how did I add data to the store ?
the data like this, the key 'evalleveldata'


{"totalcount":20,"datalist":[{"evalindexGuid":"78688a696ae94b1cae3c709df26024ea","evalindextitle":"some Text",
"evalleveldata":[{"evalindexguid":"78688a696ae94b1cae3c709df26024ea","evallevelGuid":"5b0534d4167b42e786e33943e3c43fe0","evallevelname":"Good","evallevelscore":70,"itemsort":2},{"evalindexguid":"54df0eefaaaa45da81f027d152d9ea08","evallevelGuid":"06359030f7f044378e5e9c8b566f43e2","evallevelname":"Better","evallevelscore":80,"itemsort":4},{"evalindexguid":"54df0eefaaaa45da81f027d152d9ea08","evallevelGuid":"06359030f7f044378e5e9c8b566f43e2","evallevelname":"Best","evallevelscore":90,"itemsort":4}]}...

danguba
7 Jul 2011, 1:09 AM
Try to use API
http://dev.sencha.com/deploy/ext-3.3.1/docs/?class=Ext.data.Store&member=loadData

Jack Chen
8 Jul 2011, 2:00 AM
Thank you. You are right.

danguba
8 Jul 2011, 2:11 AM
I'm glad I was able to help you