PDA

View Full Version : Changing portlet's html by dropping..



pirusira
11 May 2010, 1:21 AM
Hello,

I would like to change portlet's html by a dropped grid's row.
Like this.
2043120430

Here is the grid panel


var deviceList = new Ext.grid.GridPanel({
store: deviceListStore,
cm: new Ext.grid.ColumnModel({
columns: [
expander1,
{id:'model',header: "???", renderer:templateRenderer(new Ext.Template('<span class="modelName">{model}</span><br />{ip}'))}
]
}),
viewConfig: {
forceFit:true
},
id: 'deviceList',
autoWidth: true,
autoHeight: true,
border: false,
plugins: expander1,
ddGroup: 'gridDDGroup',
enableDragDrop: true,
stripeRows: true,
selModel: new Ext.grid.RowSelectionModel({singleSelect : true})
});
The portlet panel


var deviceGroup = new Ext.Panel({
title: '????',
region: 'center',
bodyStyle : 'background-color: #fff',
autoScroll : true,
items: [{
border: false,
xtype: 'portal',
items:[{
columnWidth:.49,
style:'padding:10px 0 10px 10px',
items:[{
title: 'Grid in a Portlet',
height: 100,
tools: tools
},{
title: 'Another Panel 1',
height: 100,
tools: tools
},{
title: 'Panel 3',
height: 100,
tools: tools
}]
},{
columnWidth:.49,
style:'padding:10px 0 10px 10px',
items:[{
title: 'Panel 2',
height: 100,
tools: tools
},{
title: 'Another Panel 2',
height: 100,
tools: tools
},{
title: 'Another Panel 3',
height: 100,
tools: tools
}]
}]
}]
});
This is the part of the handler.


notifyDrop : function(ddSource, e, data){
var selectedRecord = ddSource.dragData.selections[0];
deviceGroup.getPanel().loadRecord(selectedRecord);
ddSource.grid.store.remove(selectedRecord);
return(true);
}
But the getPanel() is not a method..
How can I change the html of appropriate portlet panel?

Thanks.
Stan

aconran
11 May 2010, 4:33 PM
Is deviceGroup in scope?

pirusira
11 May 2010, 5:15 PM
Actually, I don't know exactly what the concept of scope is.
Would you explain or give me a link about it?
Thank you for your answer.