PDA

View Full Version : Loading mask in Expander Row



Tascha
8 Oct 2009, 3:42 AM
Hi!

Someone has an idea, how I could set a loading mask while expanding with a row in a grid with the RowExpander-plugin ? (There are many datas in one row, so the user has to wait.)




Ext.onReady(function(){

var expander = new Ext.grid.RowExpander({ //compenen expanded row

tpl : new Ext.Template(
//below is a field that will expand
'<p><b>Result:</b> <br>{result:nl2br}</p><br>'
)
});



aktuell_DataStore = new Ext.data.Store({

id: 'aktuell_DataStore',
proxy: new Ext.data.HttpProxy({
url:'database.php',
method: 'GET'
}),
baseParams:{ip: ip_num, task: "GETALL"},
autoLoad: true,
reader: new Ext.data.JsonReader({
root:'results',
totalProperty:'total',
id: 'id'
},[
....columns.....

]),
sortInfo: {field: 'hostname', direction: "ASC"}

});


aktuell_ColumnModel = new Ext.grid.ColumnModel([

expander,//this is important,

{

...columns...


}]
);


aktuell_ListingEditorGrid = new Ext.grid.GridPanel({


id: 'aktuell_ListingEditorGrid',
store: aktuell_DataStore,
cm: aktuell_ColumnModel,
stripeRows: true,
height: 350,
width: 600,

plugins: expander,
loadMask:true,
listeners:{
render: function(aktuell_ListingEditorGrid){ //load the store when the grid is rendered
aktuell_ListingEditorGrid.loadMask.show();
},
delay : 100, //also give the loadMask time to init (afterRender).
single : true
},

renderTo: document.body,
columnLines: true,
bbar: new Ext.PagingToolbar({
pageSize: 25,
store: aktuell_DataStore,
displayInfo: true,
displayMsg: 'Displaying command {0} - {1} of {2}',
emptyMsg: "No content to display"

})


});

aktuell_ListingEditorGrid.render();

});


I thought, I have to change something in the RowExpander.js?
An advice to the right direction would help. I don't have any ideas...


greetings

Tascha