PDA

View Full Version : [SOLVED] Ext.data.DirectStore and Dataview



Dumbledore
1 Jul 2009, 4:05 AM
Hi,

i have a small Problem with the Directstore. How to handle the success-property? My function returns success : false, but the Dataview i connected to the Directstore is loading, loading, loading...

My PHP returns following:


$data = array(
'success' => false,
'products' => array(
array(
'product_id' => 5,
'product_name' => 'Test1'
),
array(
'product_id' => 6,
'product_name' => 'Test2'
)
)
);


Store:


var store = new Ext.data.DirectStore({
storeId : 'app_productstore',
autoLoad : true,
directFn : Ext.app.Products.getAll,
paramsAsHash: false,
root : 'products',
idProperty : 'product_id',
fields : [
{name : 'product_id', type : 'int'},
{name : 'product_name', type : 'string'},
],
listeners : {
'datachanged' : function(store){
var el = this.navigationPanel.body;
store.isFiltered() ? el.addClass('is_filtered') : el.removeClass('is_filtered')
},
'exception' : function(sender, type, action, options, response, arg ){
console.warn(response);
},
scope : this
}
});

Dumbledore
1 Jul 2009, 7:11 AM
i found it...

i have a typo in my Dataview :-(