Ext.require([
'Ext.button.Button',
'Ext.grid.property.Grid'
]);
Ext.onReady(function(){
// simulate updating the grid data via a button click
var Unit = Ext.create('Ext.data.Store', {
fields: ['abbr', 'name'],
data : [
{"abbr":"AUstralian", "name":"AUD"},
{"abbr":"Canadian", "name":"CND"},
{"abbr":"Europe", "name":"EUR"},
{"abbr":"british", "name":"GBP"},
{"abbr":"indian", "name":"INR"},
{"abbr":"united", "name":"USD"}
]
});
var Scale = Ext.create('Ext.data.Store', {
fields: ['abbr', 'name'],
data : [
{"abbr":"AUstralian", "name":"actual"},
{"abbr":"Canadian", "name":"crore"},
{"abbr":"Europe", "name":"hundred"},
{"abbr":"british", "name":"lakh"},
{"abbr":"indian", "name":"million"},
{"abbr":"united", "name":"thousand"}
]
});
var propsGrid = Ext.create('Ext.grid.property.Grid', {
width: 300,
renderTo: 'smpl',
customEditors: {
Unit: Ext.create('Ext.form.ComboBox', {
store: Unit,
queryMode: 'local',
displayField: 'name',
valueField: 'abbr',
editable: false
}),
Scale: Ext.create('Ext.form.ComboBox', {
store: Scale,
queryMode: 'local',
displayField: 'name',
valueField: 'abbr',
editable: false
})
},
source: {
"Name": "Properties Grid",
"(ID)": 'id',
"Type": true,
"SubGroup": false,
"PeriodType": Ext.Date.parse('10/15/2006', 'm/d/Y'),
"Balance": false,
"abstract": 0.01,
"Nullable": 1,
"Unit": 'USD',
"Scale":'actual'
}
});
});