PDA

View Full Version : [CLOSED] ext:Panel with Items and Loader (mixed mode)



supera
Apr 24, 2012, 11:55 AM
Hi

I have in my main page a ext:MenuPanel. For some items of menuPanel, when clicked, I wish load a aspx page in Panel. For some items, I wish loading ext:controls in Javascript in this panel... Itīs possible?

Basicly, I don't know what i do to clear the loader object.

Daniil
Apr 24, 2012, 1:45 PM
Hi,

I would implement it this way.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Ext.NET v2 Example</title>

<script type="text/javascript">
var loadSite = function (panel, url) {
panel.removeAll();
panel.add({
xtype : "panel",
loader : {
renderer : "frame",
url : "http://ext.net",
loadMask : {
showMask : true
}
}
});
};

var addComponent = function (panel, component) {
panel.removeAll();
panel.add(component);
};
</script>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:MenuPanel runat="server" Height="100">
<Menu runat="server">
<Items>
<ext:MenuItem runat="server" Text="Load some site">
<Listeners>
<Click Handler="loadSite(#{Panel1}, 'http://ext.net');" />
</Listeners>
</ext:MenuItem>
<ext:MenuItem runat="server" Text="Add some component">
<Listeners>
<Click Handler="addComponent(#{Panel1}, { xtype: 'container', html : 'Hello World!' });" />
</Listeners>
</ext:MenuItem>
</Items>
</Menu>
</ext:MenuPanel>
<ext:Panel
ID="Panel1"
runat="server"
Title="Test Panel"
Width="300"
Height="300"
Layout="FitLayout" />
</form>
</body>
</html>

supera
Apr 24, 2012, 2:45 PM
Hi Daniil!

Works very fine. Is just what I need!

Thanks a lot.