Oct 14, 2011, 3:18 PM
[CLOSED] Dynamically adding view to panel MVC
Good day,
I am having some issues dynamically adding a view to a panel since i upgrade to version 1.1. The code below worked using the 1.0 assemblies. Not sure what i need to change to get this working again. The call panel.load({ scripts: true, params: { containerId: 'panelProperties' }, url: url }); is no longer calling the action on the controller. I was able to dynamically load different panels using version 1.0 calling different controller urls.
This javascmethod is triggered on a button click
The controller action that should be triggered.
I am having some issues dynamically adding a view to a panel since i upgrade to version 1.1. The code below worked using the 1.0 assemblies. Not sure what i need to change to get this working again. The call panel.load({ scripts: true, params: { containerId: 'panelProperties' }, url: url }); is no longer calling the action on the controller. I was able to dynamically load different panels using version 1.0 calling different controller urls.
<ext:Viewport ID="Viewport1" runat="server" Layout="Border">
<Items>
<ext:TabPanel runat="server" Width="300" MinWidth="300" MaxWidth="300" IDMode="Explicit" Region ="West" >
<Items>
<ext:Panel ID="panelWorkflows" runat="server" Title="Workflows" Layout="Fit">
<Items>
</Items>
</ext:Panel>
</Items>
<Listeners>
</Listeners>
</ext:TabPanel>
<ext:Panel Frame="false" runat="server" Layout="Fit" AutoScroll="true" LabelAlign="Left" Title="Templates" MonitorResize="true" Region="Center" >
<Content>
<div id="graphSideBar" class="sideBar">
</div>
<div id="graphContainer" class="graph">
</div>
</Content>
<Items>
</Items>
</BottomBar>
<Listeners>
</Listeners>
</ext:Panel>
<ext:Panel ID="panelProperties" runat="server" Width= "350" Closable="false" HideCollapseTool="true" Collapsible= "true" Collapsed="true" Title="Properties" Hidden="true" Layout="Form" AutoScroll="true" MonitorResize="false" Region="East" >
<AutoLoad
AutoDataBind="true"
Url='/sample'
ShowMask="true"
MaskMsg="Loading Panel..."
MonitorComplete="false" NoCache="true"
>
</AutoLoad>
</ext:Panel>
</Items>
<Listeners>
<Render Handler="" />
</Listeners>
</ext:Viewport>
The view to load on the panel<ext:Panel
ID="windowProperties"
runat="server"
Width="350"
Height="510"
Cls="items-view"
Layout="Fit"
Border="false">
<Items>
</Items>
<Listeners>
<Render Handler="" />
</Listeners>
</ext:Panel>
This javascmethod is triggered on a button click
ShowProperties: function () {
WorkflowGraphHelper.initializingStatePropertiesWindow = true;
var panel = panelProperties;
panel.removeAll();
var url = '/Flow/ShowProperties';
panel.load({ scripts: true, params: { containerId: 'panelProperties' }, url: url });
panel.setTitle('State Properties');
panel.show();
panel.expand(true);
Viewport1.doLayout()
},
The controller action that should be triggered.
public ActionResult ShowProperties(String containerId)
{
Ext.Net.MVC.PartialViewResult partialViewResult = new Ext.Net.MVC.PartialViewResult(containerId);
partialViewResult.RenderMode = RenderMode.AddTo;
partialViewResult.ViewName = "StateProperties";
return partialViewResult;
}
Last edited by Daniil; Oct 14, 2011 at 6:21 PM.
Reason: [CLOSED]