Feb 22, 2011, 1:31 PM
[CLOSED] PartialView to replace the contents of a div.
Hi,
I originally posted this problem a few weeks ago:
http://forums.ext.net/showthread.php...a-DirectEvents
But the problem has come back, and I'm not sure why/how! Basically, when a row is clicked in my grid, I need to replace the contents of a Div with the results of a PartialView render. Instead of replacing the content, it's appending to the end of it.
My trigger on the RowSelect of the grid:
I originally posted this problem a few weeks ago:
http://forums.ext.net/showthread.php...a-DirectEvents
But the problem has come back, and I'm not sure why/how! Basically, when a row is clicked in my grid, I need to replace the contents of a Div with the results of a PartialView render. Instead of replacing the content, it's appending to the end of it.
My trigger on the RowSelect of the grid:
<DirectEvents>
<RowSelect Url="/Partial/ChannelView" CleanRequest="true">
<ExtraParams>
<ext:Parameter Name="containerId" Value="#{ChangesChannel}.body.id" Mode="Raw" />
<ext:Parameter Name="equipmentId" Value="#{ChangesGridPanel}.getSelectionModel().getSelected().data.EquipmentId" Mode="Raw" />
<ext:Parameter Name="equipmentPortNum" Value="#{ChangesGridPanel}.getSelectionModel().getSelected().data.EquipmentPortNum" Mode="Raw" />
</ExtraParams>
</RowSelect>
</DirectEvents>
And my controller code: public ActionResult ChannelView(string containerId, string equipmentId, string equipmentPortNum)
{
ViewData["Channel"] = _builder.BuildChannel(Convert.ToInt32(equipmentId), Convert.ToInt32(equipmentPortNum));
PartialViewResult pr = new PartialViewResult(containerId, RenderMode.RenderTo);
//pr.ControlToRender = "ChangesChannel";
return pr;
}
I can see the result from this in firebug looks like this:{script:"Ext.net.append(Ext.net.getEl(\"ext-gen17\"),[\"<div id=\\\"ID_0a6a0587239842429369028bca256a88_Container\\\">\",\"<div id=\\\"ID_0a6a0587239842429369028bca256a88_Content\\\" class=\\\"x-hidden\\\">\",\"<div class=\\\"channel\\\">\",\" \",\" \",\" <div class=\\\"channel-port\\\">\",\" \",\" <img src=\\\"/Content/Images/Port.png\\\" alt=\\\"port\\\"/>\",\" \",\" <p>WC1-R02</p>\",\" </div>\",\" \",\" <div class=\\\"channel-cable\\\">\",\" <div class=\\\"border Permanent\\\" \",\" \",\" ></div>\",\" <p>WC1-R02-10</p>\",\" </div>\",\" \",\" <div class=\\\"channel-port\\\">\",\" \",\" <img src=\\\"/Content/Images/Port.png\\\" alt=\\\"port\\\"/>\",\" \",\" <p></p>\",\" </div>\",\" \",\"</div>\",\"</div>\",\"</div>\"].join(''));Ext.net.ResourceMgr.destroyCmp(\"ID_0a6a0587239842429369028bca256a88\");new Ext.Panel({id:\"ID_0a6a0587239842429369028bca256a88\",contentEl:\"ID_0a6a0587239842429369028bca256a88_Content\",renderTo:\"ext-gen17\",border:false,header:false});"}
How can I replace instead of appending the content?
Last edited by Daniil; Feb 24, 2011 at 11:07 AM.
Reason: [CLOSED]