Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Updated 7-Apr-13 17:26pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900