[CLOSED] data binding using bind function in ext.net for mvc

  1. #1

    [CLOSED] data binding using bind function in ext.net for mvc

    Hello,

    I can see that we have an example in web form: https://examples5.ext.net/#/Data_Bin...mponent_State/

    But i can not find this example in mvc, please help to convert the sample into mvc code.

    Thanks in advance.
    Last edited by fabricio.murta; May 08, 2023 at 5:03 AM.
  2. #2
    Hello, @user2022!

    The equivalent MVC version of the example you pointed would be:

    @{
        Layout = null;
    }
    
    <!DOCTYPE html>
    
    <html>
    <head>
        <meta name="viewport" content="width=device-width" />
        <title>Component State - Ext.Net Examples</title>
    </head>
    <body>
        <div>
            @Html.X().ResourceManager()
    
            <h1>Component State</h1>
            <p>This example shows how to use basic data binding to bind the state of one component to the state of another.</p>
    
            @(
            Html.X().Panel()
                .Width(350)
                .BodyPadding(10)
                .Layout(LayoutType.Anchor)
                .Title("Sign Up Form")
                .ViewModel(true)
                .AutoDataBind(true)
                .Items(
                    Html.X().Checkbox()
                        .BoxLabel("Is Admin")
                        .Reference("isAdmin"),
                    Html.X().TextField()
                        .FieldLabel("Admin Key")
                        .Anchor("0")
                        .Bind(
                            conditions => conditions.Add(new Ext.Net.Parameter("disabled", "{!isAdmin.checked}"))
                        )
                )
            )
        </div>
    </body>
    </html>
    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Hello fabricio.murta,

    Thanks for your help, please help to close this thread.
  4. #4
    Glad we could be of help! Closing; thank you for the feedback!

Similar Threads

  1. Replies: 0
    Last Post: Apr 22, 2012, 9:39 AM
  2. [CLOSED] Data binding to NetTiers data entity objects
    By vadym.f in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Apr 09, 2012, 3:35 PM
  3. Replies: 1
    Last Post: Dec 11, 2011, 6:45 AM
  4. Data Binding
    By Deepak in forum 1.x Help
    Replies: 3
    Last Post: Nov 04, 2010, 10:27 AM
  5. Replies: 0
    Last Post: Jun 19, 2009, 4:18 AM

Posting Permissions