Hi,
I am using Sencha Touch2. Here I have created the following store,
Ext.define
(
'myproject.store.ServiceCategory',
{
extend: 'Ext.data.Store',
//requires:['myproject.model.ServiceCategory'],
alias: 'store.ServiceCategory',
// config:
// {
model: 'myproject.model.ServiceCategory',
storedId: 'servicecategory',
proxy:
{
type: 'ajax',
url: myurl
scope: this,
extraParams:
{
method : 'servicecategory',
ModuleName : 'mymodule' },
reader:
{
type: 'json',
rootProperty: 'data'
}
},
autoLoad: true,
//}
}
);
My model is
Ext.define('myproject.model.ServiceCategory',
{
extend: 'Ext.data.Model',
config:
{
fields:
[
'Id',
'ServiceCategoryName'
]
}
});
In above store i am using in selectfiel like as following,
{
xtype : 'selectfield', label : 'Category',
displayField: 'ServiceCategoryName',
valueField : 'Id',
store : ServiceCategoryStore,
name : 'ServiceCategory',
id : 'cbServiceCategory',
Store value is not loading. Suppose in Store if I add Config its not working at all. If I remove the config my proxy url is not calling at all. Suppose if I do the code following
var ServiceCategoryStore = Ext.create('Ext.data.Store',
{
model: 'myproject.model.ServiceCategory',
proxy:
{
type: 'jsonp',
url: myurl,
scope: this,
extraParams:
{
method : 'servicecategory',
ModuleName : 'Incident' },
reader:
{
type: 'json',
rootProperty: 'data'
}
},
autoLoad: true
});
and in selectfiel
store : ServiceCategoryStore
It is calling the url and loading it. What is the problem in my store?
Please suggest me... And also if I put the hard code value directly in store the value is loading in my selectfield.