Dec 02, 2008, 7:19 AM
Dynamic grid in usercontrol
Hi All,
in previous posts http://forums.ext.net/showthread.php...4393-16-1.aspx
we talked about creating GridPanel at runtime. All fine at Page_Load of an aspx page.
Reproducing code would be too long, so in my app. I have this structure:
UserControl_A -> Button -> click AjaxEvent
AjaxEvent does the following:
- retrieve a DataTable
- Load UserControl_B in wich at page_init I server side add store, grid etc.
- pass DataTable to the grid
After I click the button I get: ctl139_StoreRicerca is not defined
Code in my error console (coolite-core-js/coolite.axd):
Hope is clear
Thanx
Matteo
in previous posts http://forums.ext.net/showthread.php...4393-16-1.aspx
we talked about creating GridPanel at runtime. All fine at Page_Load of an aspx page.
Reproducing code would be too long, so in my app. I have this structure:
UserControl_A -> Button -> click AjaxEvent
AjaxEvent does the following:
- retrieve a DataTable
- Load UserControl_B in wich at page_init I server side add store, grid etc.
- pass DataTable to the grid
After I click the button I get: ctl139_StoreRicerca is not defined
Code in my error console (coolite-core-js/coolite.axd):
var executeScript = function(o, result, response) {
var delay = 0;
var em = o.eventMask || {};
if (em.minDelay) {
delay = em.minDelay;
}
var task = new Ext.util.DelayedTask(
function(o, result, response) {
if (result.script && result.script.length > 0) {
eval(result.script);
}
if (o.userSuccess) {
o.userSuccess(response, result, o.control, o.eventType, o.action, o.extraParams, o);
}
},
o.scope, [o, result, response]).delay(delay);
};
// at eval(result.script); cursor breaks
When I load UserControl I passed an ID to the UC object instance.
Coolite.Ext.Web.Panel _pnlRisultatoRicerca = (Coolite.Ext.Web.Panel)this.Page.FindControl("PanelRisultatoRicerca");
UserControlBase _ucRisultati = (UserControlBase)this.LoadControl("RisultatoRicerca.ascx");
_ucRisultati.ID = "ucRes";
_pnlRisultatoRicerca.BodyContainer.Controls.Add(_ucRisultati);
Where am I wrong?Hope is clear
Thanx
Matteo