PDA

View Full Version : How add SearchField.js ?



Bkmz
2 Dec 2011, 8:57 PM
I try add SearchField.js to my app


{
xtype: 'toolbar',
dock: 'bottom',
items: [
{
xtype: 'pagingtoolbar',
store: 'Firms',
width: 270,
},
{
xtype:'tbfill'
},
{
xtype: 'searchfield',
store: 'Firms',
params: {start: 0, limit: 16}
}
]
}

but have error.


store.getProxy is not a function
proxy = store.getProxy(),


what is wrong?


29770

mitchellsimoens
5 Dec 2011, 6:31 AM
Can I see your code for the store and model?

Bkmz
5 Dec 2011, 12:26 PM
Ext.define('MyApp.store.Firms', {
extend: 'Ext.data.Store',

fields: [
{name: 'name'}
],
pageSize: 16,
storeId: 'Firms',
proxy: {
type: 'ajax',
actionMethods: {
create : 'POST',
read : 'POST',
update : 'POST',
destroy: 'POST'
},
url: 'firmslist',
reader: {
type: 'json',
root: 'results'
}
},
autoLoad: true

});