PDA

View Full Version : LoadMask Problem



FelixS
10 Nov 2009, 4:36 AM
Hello Guys,

i´ve got a problem with my Grid and a JSONStore behind it. I try to use the loadMask property but it doesn´t work. I doesn´t appear at all. Here is the code I use. Perhabs someone has an idea what I´m doing wrong:

product_grid = function(config) {
Ext.apply(this, config);

product_grid.superclass.constructor.call(this, {
id:"productgrid",
store: new Ext.data.JsonStore({
storeId:'productstore',
url: 'http://localhost:8085/design/data/products.json',
root: 'Products',
fields: [
{name: 'ProductNo', type: 'string'},
{name: 'Country', type: 'string'},
{name: 'Artist', type: 'string'},
{name: 'Title', type: 'string'},
{name: 'Config', type: 'string'}
],
sortInfo: {field:'Country',direction:'DESC'}
}),
columns: [
{
header: 'Country',
dataIndex: 'Country',
width: 80,
sortable: true
},{
header: 'Product No.',
dataIndex: 'ProductNo',
width: 90,
sortable: true
},{
header: 'Artist',
dataIndex: 'Artist',
width: 90,
sortable: true
},{
header: 'Title',
dataIndex: 'Title',
width: 90,
sortable: true
},{
header: 'Configuration',
dataIndex: 'Configuration',
width: 80,
sortable: true
}
],
stripeRows: true,
listeners: {
'render': this.getData,
scope: this
},
loadMask:true
});
};

Ext.extend(product_grid, Ext.grid.GridPanel, {

getData : function(g) {
g.store.load();
}

});

Thanks a lot

Felix

Condor
10 Nov 2009, 5:01 AM
Try using:

listeners: {
afterlayout: {
fn: this.getData,
single: true,
scope: this
}
}

(the grid doesn't have a size yet in the render event, so the load mask will have height:0)