The docs state that the loadMask config property should either be a Boolean or
an Ext.LoadMask config. So that is where you should configure the mask, not in
the show event listener. The docs are incomplete in that they don't tell you
that you actually only need to supply the Ext.LoadMask options portion of the
Ext.LoadMask constructor and that the grid is also binding the grid's store and
that config option is not needed (it will be overwritten if you do add it).
This means that you really only need to supply the 'msg' option for the
loadMask unless you need to give it a different CSS class or only want it show
the very first time the grid's data store is loaded.
Here is the source code from Ext.GridPanel's initEvents function
// private
initEvents : function(){
Ext.grid.GridPanel.superclass.initEvents.call(this);
if(this.loadMask){
this.loadMask = new Ext.LoadMask(this.bwrap,
Ext.apply({store:this.store}, this.loadMask));
}
}
So a better config your grid's loadMask property would be:
loadMask:{msg:'Daten werden geladen...'},
Hope that helps
Matt Priour
Kestrel Computer Consulting
From: Robert Buckley
Sent: Wednesday, January 12, 2011 10:24 AM
To: [email protected]
Subject: [Users] Loading mask in grid
Hi,
I´m trying to put a loading mask into a grid whilst it´s being loaded. This
seems to be rather problematic althought the examples make it seem easy.
Here is my code without the mask.
var wea_attribgridPanel = new Ext.grid.GridPanel({
title: "Tabelle",
region: "center",
autoWidth : true,
stripeRows: true,
height: 350,
loadMask: true,
viewConfig: {
forceFit: true
},
store: wea_store,
sm: new GeoExt.grid.FeatureSelectionModel(),
cm: new Ext.grid.ColumnModel({
defaults: {
sortable: true
},
columns: [{
header: "Bez",
dataIndex: "Bez",
width: 25
}, {
header: "Standort",
dataIndex: "Standort"
}, {
header: "Betreiber",
dataIndex: "Betreiber",
width: 135
}]
}),
bbar: [{
text: "an Auswahl heranzoomen",
handler: function(){
wea_attribgridPanel.getSelectionModel().each(function(rec){
var feature = rec.get("feature");
wea_mapPanel.map.zoomToExtent(feature.geometry.getBounds());
})
}
},toolbarItems]
});
I though If I put this in after the bbar it would work, but nothing happens
listeners:{show:function() {
this.loadMask = new Ext.LoadMask(this.body, {
msg:'Daten werden geladen...'
});
}}
could anyone offer any assistance?
thanks,
Robert
--------------------------------------------------------------------------------
_______________________________________________
Users mailing list
[email protected]
http://www.geoext.org/cgi-bin/mailman/listinfo/users
_______________________________________________
Users mailing list
[email protected]
http://www.geoext.org/cgi-bin/mailman/listinfo/users