PDA

View Full Version : [CLOSED] Calling the javascript function in aspx page within ext:Panel after loading



supera
Apr 09, 2012, 12:03 PM
Hi

I have a main page with a ext:Panel. In this ext:Panel, I'm loading a child aspx page within. I wish a listener to call a javascript function after the aspx page is completely loaded in ext:Panel.

The listener 'Load' in tag 'Loader' appears triggered before completely load page.

Thanks for any help.

Daniil
Apr 09, 2012, 1:16 PM
Hi,

Well, the Load event is fired after a successful load.
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.ElementLoader-event-load

And it's completely loaded, i.e. a browser has already got a response.

But ComponentLoader knows nothing about a response. For example, you load a page with Ext.NET controls. They take some time for rendering and it happens the moment when a page is loaded. ComponentLoader can't know how much time they will take to be rendered.

So, the following is wrong:

The listener 'Load' in tag 'Loader' appears triggered before completely load page.

Probably, you should use the AfterRender event of a top level widget within a child page.

supera
Apr 09, 2012, 2:58 PM
Ok ,thanks Daniil... I will do what you suggest.
If you want, you can close this thead.

Daniil
Apr 09, 2012, 3:01 PM
Ok, I will mark as closed.

Please feel free to update the thread if you will be in trouble further.

kripanand
Oct 23, 2012, 6:32 AM
<script type="text/javascript">
var template = '<span style="color:{0};">{1}</span>';
var date1 = "";
var RenderDateswise = function (value) {

var date = new Date(value);
var userdate = date.getMonth().toString() + '-' + date.getDate().toString() + '-' + date.getFullYear().toString();
date1 = date.getDate().toString();
return userdate;

};
var RenderOpportunityNumber = function (value, p, record) {

var date2 = date1;

var d = new Date();

var todaydate = "6";
if (date1 == todaydate)
{
return String.format(template, "green", value);

}
else
{
return String.format(template, "red", value);
}

var RenderOpportunityNumber = function (value, p, record) {
if (value.substr(0, 1) == "S") {
return String.format('<b><a href=#")\'>{0}</a></b>', value);
} else {
return String.format('<b><a href=#")\'>{0}</a></b>', value);
}
};


};


</script>

Daniil
Oct 23, 2012, 2:19 PM
Hi @kripanand,

Welcome to the Ext.NET forums!

Please start a new forum thread. If you feel the threads are related, please feel free to cross link between the two.