[CLOSED] Need help with MVC bodywidget

  1. #1

    [CLOSED] Need help with MVC bodywidget

    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: https://examples2.ext.net/#/MessageB...ut/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
    Last edited by Daniil; Mar 22, 2014 at 3:38 PM. Reason: [CLOSED]
  2. #2
    Hi

    The same what you do in Callouts
    .BodyWidget(bw => {
                    bw.Add(new DataView());
                })
    Vladimir Shcheglov
    Sr. Developer
  3. #3
    Yep - that's it. I was so close! LOL!

    Thanks Vladimir.

Posting Permissions