PDA

View Full Version : [CLOSED] Need help with MVC bodywidget



jpadgett
Mar 19, 2014, 9:05 PM
I've been trying to translate the delegate callouts example to MVC and I'm stuck on the BodyWidget. Could someone point me in the right direction?

Example: http://examples2.ext.net/#/MessageBox/Callout/Delegation/

WebForm code:


<Callouts>
<ext:Callout
runat="server"
Trigger="Hover"
Alignment="Left"
Delegate=".x-grid-cell-Products"
BodyStyle="padding:0px;">
<BodyWidget>
<ext:DataView runat="server" Width="250" Cls="list" ItemSelector="li">
<Store>
<ext:Store runat="server">
<Fields>
<ext:ModelField Name="Id" />
<ext:ModelField Name="Name" />
</Fields>
</ext:Store>
</Store>
<Tpl>
<Html>
<ul>
<tpl for=".">
<li>
<div class="pId">#{Id}</div>
<div class="pName">{Name}</div>
</li>
</tpl>
</ul>
</Html>
</Tpl>
</ext:DataView>
</BodyWidget>
<Listeners>
<BeforeShow Fn="setCalloutContent" />
</Listeners>
</ext:Callout>
</Callouts>


I got this far:


.Callouts(cos =>
{
cos.Add(
Html.X().Callout()
.Trigger(CalloutTrigger.Hover)
.Alignment(AnchorPoint.Left)
.Delegate(".x-grid-cell-HasEmptyTables")
.BodyWidget(
Html.X().DataView()
.Width(250)
.Cls("hover-list")
.ItemSelector("li")
)
);
})


Intellisense does not like the BodyWidget here. Getting a "Best overloaded method match ... has some invalid arguments". I tried a version of bw => { ... } as well, but couldn't figure that way out either.

Thanks in advance!
Joel

Vladimir
Mar 19, 2014, 9:55 PM
Hi

The same what you do in Callouts


.BodyWidget(bw => {
bw.Add(new DataView());
})

jpadgett
Mar 21, 2014, 7:19 PM
Yep - that's it. I was so close! LOL!

Thanks Vladimir.