PDA

View Full Version : DirectStore params



jvolt
13 May 2010, 1:04 PM
Hello everyone, why this code just dont pass the params correctly?

Firebug shows Data [ ] (Empty) =(


var store_cidade = new Ext.data.DirectStore({
reader: new Ext.data.JsonReader({
root: 'list',
fields: [
{name: 'chv_estado', type: 'int'},
{name: 'cidade', type: 'string'},
{name: 'chv_cidade', type: 'int'}
]
}),
params: {'chv_estado': 22},
paramsAsHash: false,
autoLoad: true,
sm: new Ext.grid.RowSelectionModel({singleSelect:true}),
directFn: Cadastro.getCidades
});

Its the right way?

aconran
13 May 2010, 2:54 PM
You have set paramsAsHash to false. Setup your paramOrder so that the store can know how to pass the args to to Cadastro.getCidades

jvolt
13 May 2010, 4:57 PM
Thanks aconran, i will try that
Ext and Community is really fantastic
=D

jvolt
14 May 2010, 6:18 AM
[SOLVED] by using baseParams instead of params, seems as the "params" just work on load/reload the store, but no in declaration.