1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
var userStore;
var test;
Ext.require('Ext.data.Store');
Ext.define('User', {
extend: 'Ext.data.Model',
fields: [
{name: 'id', type: 'int'},
{name: 'name', type: 'string'}
]
});
Ext.onReady(function() {
Ext.QuickTips.init();
userStore = Ext.create('Ext.data.Store', {
autoLoad: true,
fields: ['id','name'],
proxy: {
type: 'ajax',
url: 'users.json',
reader: {
type: 'json',
root: 'users',
successProperty: 'success'
}
}
});
test = Ext.create('Ext.form.field.TextArea',{
renderTo: Ext.getDom('test'),
name: 'objet_detail_contact',
id: 'objet_detail_contact',
autoScroll: 'auto',
width: 400,
height: 100,
anchor: '100%',
readOnly: true,
value: userStore.getAt(0).get('name')
});
}); |
Partager