PDA

View Full Version : d.read is not a function



surindersammy
17 May 2012, 3:08 AM
Store


Ext.define('Saas.store.SalesTeamStore', {
alias:'widget.SalesTeamStore',
extend: 'Ext.data.Store',
model : 'Saas.model.SalesTeamModel',
autoLoad: true,
remoteFilter:true,
pageSize: Ext.PAGE_SIZE,
proxy : {
type : 'jsonp',
url: '../sales_teams/get_all',
reader : {
type : 'json',
root : 'SalesTeams',
totalProperty: 'TotalRows'
}
}
});

Model


Ext.define('Saas.model.SalesTeamModel', {
extend: 'Ext.data.Model',
fields: ['id','name']
});

Combo


{
xtype : 'combo',
name : 'sales_team_id',
fieldLabel : 'Sales Team',
displayField:'name',
valueField :'id',
store :'SalesTeamStore'
}

response is:


Ext.data.JsonP.callback20({"SalesTeams":[{"id":"1","name":"HR Department","user_name":"Surinder Sammy"},{"id":"2","name":"WareHouse","user_name":"Surinder Sammy"}],"TotalRows":2})


data not showing in combo, my store load in application.js(app file on root)

scottmartin
17 May 2012, 5:33 AM
Are you trying to open a local file with jsonp? try using 'file://' instead.

Scott.

surindersammy
17 May 2012, 5:34 AM
i am using codeigniter in backend.

evant
17 May 2012, 5:37 AM
Suggest reading the docs: http://docs.sencha.com/ext-js/4-0/#!/api/Ext.data.proxy.JsonP

surindersammy
17 May 2012, 5:49 AM
can u pls explain me what is the exact reason of this error

surindersammy
17 May 2012, 5:52 AM
i am sending request to my sales_teams controller get_all action and it return me json data with callback function