onExpandBody: function(rowNode, record, expandRow) {
var containerName = "OrderRow" + record.get('OrderNumber'),
grid = Ext.getCmp ('grdOrders'); //go up from the node?
// See if the panel already exists from a previously expanded row and kill it.
var oldPanel = Ext.getCmp('pnlOrderRow');
if (oldPanel !== undefined) {
oldPanel.destroy();
}
// Collapse the prevoiusly expanded row
if (this.lastExpandedRowIdx !== undefined && this.lastExpandedRowIdx !== rowNode.rowIndex){
var rowex = grid.getPlugin('OrdersRowExpander');
var row = Ext.get(rowex.view.getNode(this.lastExpandedRowIdx));
row.addCls(rowex.rowCollapsedCls);
}
// store the currently expanded row index
this.lastExpandedRowIdx = rowNode.rowIndex;
// Create the panel inside the row
var holderPanel = Ext.create("SalesOrderHistory.view.pnlOrderRow");
holderPanel.render(containerName);
// I don't know why I have the following line
holderPanel.getEl().swallowEvent(['mouseover', 'mousedown', 'click', 'dblclick']);
// Load all the sotres on the details panel
var newURL = baseURL + 'jsonWeb.p?mode=OrderLines&orderNo=' + record.get('OrderNumber') +
'&SessionToken=' + SessionToken;
var ds = Ext.getStore('strOrderLine');
ds.proxy.url = newURL;
ds.load();
},
Easy One - Small working snipit to improve
Aucun commentaire:
Enregistrer un commentaire