[CLOSED] Portlet Listeners with Razor

  1. #1

    [CLOSED] Portlet Listeners with Razor

    Hi,

    I can't find a way to intercept Portlet expand event in Razor. I just want to do something like this code example (it works with Panel instead of Portlet) :

    Html.X().Portlet()
        .Listeners(l => l.Expand.Handler = "alert('ok');")
    I tried "AddListener" and "On", but they don't work.

    How can I do..?

    Thanks
    Last edited by Daniil; Sep 18, 2012 at 12:46 PM. Reason: [CLOSED]
  2. #2
    Hi,

    The Expand event is triggered when I expand the Portlet in the example below.

    Please provide your test case.

    Example
    <!DOCTYPE html>
     
    <html>
    <head>
        <title>Ext.Net.MVC v2 Example</title>    
    </head>
    <body>
        @Html.X().ResourceManager()
     
        @(Html.X().Portal()
            .Width(200)
            .Height(200)
            .Items(
                Html.X().PortalColumn()
                    .Items(
                        Html.X().Portlet()
                            .Title("Portlet")
                            .Collapsed(true)
                            .Listeners(ls => 
                                ls.Expand.Handler = "alert('Expand')"
                            )
                    )
            )
        )
    </body>
    </html>
  3. #3
    This is an example :

    @{
        ViewBag.Title = "Index";
    }
               
    <!DOCTYPE html>
    <html>
    <head>
        <title>@ViewBag.Title</title>
        <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    </head>
    <body>
         @Html.X().ResourceManager()
         
        <div>
            @(Html.X().Panel()
                .Items(panel => {
                    panel.Add(Html.X().Portal()
                            .Border(false)
                            .Layout(LayoutType.Column)
                            .Items(portal => {
                                    portal.Add(Html.X().PortalColumn()
                                        .ColumnWidth(1)
                                        .Layout(LayoutType.Anchor)
                                        .Items(portalColumn =>
                                        {
                                                portalColumn.Add(
                                                    Html.X().Portlet()
                                                    //Html.X().Panel()
                                                    .CloseAction(CloseAction.Hide)
                                                    .Collapsible(true)
                                                    .Closable(true)
                                                    .Listeners(l => l.Expand.Handler = "alert('ok');")
                                                    .Title("Title")
                                                );
                                            })
                                    );
                                })
                        );
                    }
            )
        )
     
        </div>
    </body>
    </html>
    The compiler says that 'Ext.Net.Portlet.Builder' doesn't conteins a definition for 'Listeners' and there's no extension methods.

    It works if I use Html.X().Panel() instead of //Html.X().Portlet()
  4. #4
    Your example doesn't work with Portlet, neither with Panel...
  5. #5
    I can confirm that Danill's example works correctly
    What version do you use?
    I recommend to update from 2.1 branch
    http://svn.ext.net/premium/branches/2.1
  6. #6
    Uhmmmm ok, so the problem is my version.

    I use NuGet to install Ext.Net on my projects, version is 2.0.0rc2.

    I tried to get the latest in SVN using my forum credentials, but username and password seem to be invalid: aren't them the same?
  7. #7
    Yes, they are different. The SVN credentials should be sent to you when you got the Premium Support Subscription.

    Please check the Inbox. If they are lost, please send a request with your forum name to:
    support@object.net

Similar Threads

  1. [CLOSED] [RAZOR] DraggablePanelConfig doesn't have StartDrag in Razor
    By UnifyEducation in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 28, 2012, 2:37 PM
  2. [CLOSED] [Razor] Setup Auto load panel in razor
    By UnifyEducation in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 27, 2012, 10:54 AM
  3. [CLOSED] Listeners for Tree Panel (Razor Views)
    By machinableed in forum 2.x Legacy Premium Help
    Replies: 24
    Last Post: Apr 04, 2012, 7:56 AM
  4. Replies: 4
    Last Post: Apr 08, 2010, 8:05 PM
  5. Replies: 0
    Last Post: Mar 03, 2010, 9:51 AM

Tags for this Thread

Posting Permissions