[CLOSED] Right and Left Buttons in MVC Syntax

  1. #1

    [CLOSED] Right and Left Buttons in MVC Syntax

    Can you please provide the syntax for

    TextField() - RightButtons and LeftButtons for MVC?
    The examples I've see so far have been for WebForms only.

    As outlined in your "New for Ext 2.3 Blog"

    Thanks,
    Leo
    Last edited by Daniil; Nov 25, 2013 at 11:18 AM. Reason: [CLOSED]
  2. #2
    Hello!

    Sorry, it seems these properties are missed in MVC. We will fix it. Temporarily use the following:

    @(X.Window()
        .Width(550)
        .Height(250)
        .Title("Buttons of Field")
        .Closable(false)
        .BodyPadding(5)
        .Layout("Form")
        .Defaults(d => X.Parameter().Name("LabelWidth").Value("200"))
        .Items(
            X.TextField()
                .FieldLabel("Right buttons")
                .CustomConfig(c =>
                {
                    c.Add(new ConfigItem("rightButtons", "[{iconCls: '#Add'},{iconCls:'#Accept'}]", ParameterMode.Raw));
                }),
            X.TextField()
                .FieldLabel("Left buttons")
                .CustomConfig(c =>
                {
                    c.Add(new ConfigItem("leftButtons", "[{iconCls: '#Add'},{iconCls:'#Accept'}]", ParameterMode.Raw));
                })
        )
    )
    Last edited by Baidaly; Nov 23, 2013 at 5:38 PM.
  3. #3
    I suggest to use Control method instead CustomConfig
    @(Html.X().TextField()
          .Control(field => { 
                   field.RightButtons.Add(new Ext.Net.Button { Icon = Icon.Add }); 
                   field.RightButtons.Add(new Ext.Net.Button { Icon = Icon.Accept }); 
          })
    )
  4. #4
    Convenient builders have been added to the trunk. It will go to the next release (v2.4).

    Example
    @{
        var X = Html.X(); 
    }
    
    <!DOCTYPE html>
    <html>
    <head>
        <title>Ext.Net.MVC v2 Example</title>  
    </head>
    <body>
        @X.ResourceManager()
    
        @X.TextField().RightButtons(new Button() { Icon = Icon.Add }, new Button() { Icon = Icon.Accept })
        @X.TextField().RightButtons(new Button() { Icon = Icon.Add })
        @X.TextField().RightButtons(new List<ButtonBase> { new Button() { Icon = Icon.Add }, new Button() { Icon = Icon.Accept } })
    
        @X.TextField().LeftButtons(new Button() { Icon = Icon.Add }, new Button() { Icon = Icon.Accept })
        @X.TextField().LeftButtons(new Button() { Icon = Icon.Add })
        @X.TextField().LeftButtons(new List<ButtonBase> { new Button() { Icon = Icon.Add }, new Button() { Icon = Icon.Accept } })
    </body>
    </html>

Similar Threads

  1. [ASK] tabPanel.add razor syntax
    By 4L4Y in forum 2.x Help
    Replies: 2
    Last Post: May 21, 2013, 9:29 AM
  2. [CLOSED] Align formpanel buttons far left / far right
    By CarWise in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 12, 2013, 11:22 AM
  3. how to left align the grid buttons
    By harshad.jadhav in forum 1.x Help
    Replies: 2
    Last Post: Nov 30, 2010, 8:00 AM
  4. [CLOSED] [1.0] Radio buttons that appear as buttons
    By MP in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Mar 24, 2010, 6:28 PM
  5. Image buttons / Custom built buttons
    By conman in forum 1.x Help
    Replies: 2
    Last Post: Jul 15, 2008, 11:01 AM

Tags for this Thread

Posting Permissions