Check if all ComboBoxes are selected.

  1. #1

    Check if all ComboBoxes are selected.

    Hello.
    I have three ComboBoxes, there is code. I want to check if all comboboxes are selected and then load grid by Ajax. I think, that I should use JavaScript but don't know how. How can I do that?
    @(x.FieldSet()
                                        .Collapsible(true)
                                        .Collapsed(false)
                                        .Layout(LayoutType.Column)
                                        .Items(
                                            x.ComboBox().FieldLabel("Год:")
                                            .EmptyText("Select Year")
                                            .Items(
                                                new ListItem("2014", "2014"),
                                                new ListItem("2015", "2015"),
                                                new ListItem("2016", "2016")
                                                    ).ColumnWidth(0.30),
    
                                            x.ComboBox()
                                            .FieldLabel("Период:")
                                            .EmptyText("Select Period")
                                            .Items(
                                                new ListItem("1 кв.", "1 кв."),
                                                new ListItem("2 кв.", "2 кв."),
                                                new ListItem("3 кв.", "3 кв."),
                                                new ListItem("4 кв.", "4 кв.")
                                                    ).ColumnWidth(0.30).StyleSpec("margin-left: 50px;"),
                                                    
                                            x.ComboBox()
                                                .FieldLabel("Организация:")
                                                .EmptyText("Select Organisation")
                                                .DisplayField("Name")
                                                .Store(x.Store()
                                                    .Data(Model.BalanceDropDownOutput)
                                                    .Model(Html.X().Model()
                                                    .IDProperty("Id")
                                                        .Fields(
                                                            new ModelField("Id", ModelFieldType.String) { Mapping = "ORG" },
                                                            new ModelField("Name", ModelFieldType.String) { Mapping = "KBO" }
                                                        )
                                                    ))
                                                    .ColumnWidth(0.6).StyleSpec("margin-top: 10px;")
                                                )
    )
    Last edited by gigola9; Dec 21, 2018 at 12:09 PM.
  2. #2
    Hello @gigola9, and welcome to Ext.NET forums!

    There are just too many ways to attain what you need, I will describe you one possible solution, please try to think about it, browse some of our online examples, and merge it on your actual use case:

    - Every combo box has a select event. You probably want to use the 'listener' (or client-side) version of the event. There's also the 'Directevent' one, but that requires a round-trip to the server and, for this task, sounds like too much.
    - To each combo box, when it gets a value selected, in that select event, check if the other two have a value selected; which may be empty, a single value or an array of values (if that's "multiselect" combobox).
    - whenever the test of one combobox yields true, show the panel.

    This example shows using the select event (as a listener): Ajax Linked combos

    I hope this helps you attain the desired result!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. [CLOSED] Grid panel selected row cout check-MVC
    By matrixwebtech in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Jun 11, 2014, 2:00 PM
  2. Replies: 4
    Last Post: Mar 12, 2013, 12:53 AM
  3. Replies: 6
    Last Post: Sep 21, 2011, 9:37 AM
  4. Replies: 3
    Last Post: Dec 21, 2010, 2:57 PM
  5. Replies: 4
    Last Post: Jun 23, 2009, 10:11 AM

Tags for this Thread

Posting Permissions