Mar 03, 2011, 9:02 AM
AddListener for Ext.Panel Runtime from codebehind
Hello Team Master,
I'm trying to create a similar calendar panel grid, with simple ext.panel (I must customize other function, so Calendar Panel doesn't help me).
When I'm creating my ext.panel runtime from C# (for celldays or cellweek) I can set properties as ID , HTML , BORDERSTYLE but i can't handle click on panel.
this is my function:
Someone could help me?
Having a nice day
Fabio
I'm trying to create a similar calendar panel grid, with simple ext.panel (I must customize other function, so Calendar Panel doesn't help me).
When I'm creating my ext.panel runtime from C# (for celldays or cellweek) I can set properties as ID , HTML , BORDERSTYLE but i can't handle click on panel.
this is my function:
string fn = "Ext.Msg.alert('Confirm', String.format('You Clicked {0}', el.id));";
string MinWk = 'Ciao';
for (i = 1,iweek=1; (i <= 48); i++)
{
Ext.Net.Panel PanelGrid = new Ext.Net.Panel();
PanelGrid.ID = NomePanel + i + month;
PanelGrid.Header = false;
PanelGrid.Html = (i == iweek) ? "<p>" + MinWk + "</p>" : "<p>" + i + "</p>";
//PanelGrid.AddListener("render", "function(el) {el.body.on('click',function(){" + fn + "})}");
//PanelGrid.On("click", "function(el) {" + fn + "}");
// I'm rendering 48 Panels inside TableLayout named LayoutGridCal ,so I must create Cell also
Cell mycell = new Cell();
//mycell.CellCls = (i == iweek) ? "cellaW" : "cellaD";
mycell.Items.Add(PanelGrid);
//
LayoutGridCal.Cells.Add(mycell);
// Counter for Special Week different from normal Calendar Week
MinWk = (i == iweek) ? MinWk+1 : MinWk;
iweek = (i==iweek)?iweek + 8:iweek;
}
Both way doesn't work (On or AddListener).Someone could help me?
Having a nice day
Fabio