-
Sencha User
Select Field
hai all,
i want to list the records in select field from store...how to do these...
-
Sencha User
Check following example:
var storeValue=loadCommentStore();
function loadCommentStore()
{
Ext.regModel('preferencesComments', {
fields: [
"text",
"id"
]
});
var store = new Ext.data.Store({
model:'preferencesComments',
proxy: {
type: 'memory',
reader: {
type: 'json',
model: 'preferencesComments',
root:'comments'
}
}
});
commentsdata = eval("(" + commentsdata + ")");
store.loadRecords(store.proxy.reader.read(commentsdata).records);
return store;
}
In the select field you can specify the variable in which your store is (in this case its storeValue.)
xtype: 'selectfield',
name:'PreConfigureComment',
store: storeValue,
displayField: 'text',
valueField: 'text',
listeners:{
change: function(selectField, value){
var form = myform.getValues();
// do your processing
}
}
Description:
Function loadCommentStore() return the store which is kept in variable storeValue, this variable is used in store config of the select field .
Hope this helps.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules