dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.33k stars 9.97k forks source link

[Feature] First party multi column autocomplete dropdown box. #25052

Closed davidbuckleyni closed 4 years ago

davidbuckleyni commented 4 years ago

Is your feature request related to a problem? Please describe.

its is very common for people to want to show multiple columns in a dropdown box on the web as their a good way to display information but requiring only one field for reference.

Describe the solution you'd like

Simliar to how the Kendo Ui one works the in built one would work as folows

  @(Html.MultiColumnComboBox()
                 .Name("tagItem")
                 .DataTextField("name")
                 .DataValueField("SearchId")
                 .Filter("contains")
                 .FilterFields(new string[] { "name", "ContactTitle", "CompanyName", "Country" })
                   .Columns(columns =>
                    {
                        columns.Add().Field("name").Title("Contact Name").Width("200px");
                        columns.Add().Field("dob").Title("Date Of Brith").Width("200px");

                       We could have other column types such as button  when when clicked would pass the id of the user.
                               columns.Add().Button("btnlinkcase")
                     Would add a checkbox to the list
                      columns.Add().CheckBox("chklinkcase")

                        })
                        .FooterTemplate("Total #: instance.dataSource.total() # items found")
                        .HtmlAttributes(new { style = "width:80%;" })
                        .Height(400)
                        .DataSource(source => source
                            .Custom()
                            .Transport(transport => transport
                                .Read(read =>
                                {
                                    read.Action("SearchQuery", "MISObjects")
                                        .Data("onAdditionalData");
                                }))
                        )
                        )

You should be able to post the values to a controller method for retrieveal such as the id etc.

Additional context

For example as per below once a person starts typing it should filter the results for example if I type Matt only mat should be visible and the id of Matt should be visible within the html.

image

When no items have been search it should display all the items in the list or the Iqueryable that the user has sent to the field.

image

pranavkm commented 4 years ago

Thank you for your suggestion @davidbuckleyni. This is not an area we plan to invest in. We recommend looking for community or 3rd party solutions.