Hi Luca,
Currently we don’t have the support to achieve this behavior “multiple columns in the AutoComplete”, and we have logged your requirement as a feature request in our database. A support incident to track the status of this issue has been created under your account. Please log on to our support website to check for further updates.
https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents
Please let us know if you have further concern.
Regards,
Kasithangam
Hi, is it in latest version already support for behavior multicolumn in the Autocomplete inside the grid? If yes, could you please provide me the sample? Thank
Hi Fatin,
Query: is it in latest version already support for behavior multicolumn in the Autocomplete inside the grid? If yes, could you please provide me the sample? Thank
Yes, You can use the multicolumn in the autocomplete inside the grid. We achieved your query by using the Edit Template feature of the grid.
Please refer to the below code example,
<ej:Grid ID="OrdersGrid" runat="server" AllowPaging="true" AllowSelection="true" AllowFiltering ="true">
… <ej:Column Field="CustomerID" HeaderText="Customer Name" Width="80" > <EditTemplate Create="create" Read="read" Write="write" /> </ej:Column> .. </Columns> <EditSettings AllowEditing="True" AllowAdding="True" AllowDeleting="True" EditMode="Normal"></EditSettings> <ToolbarSettings ShowToolbar="True" ToolbarItems="add,edit,delete,update,cancel"></ToolbarSettings> </ej:Grid> <script type="text/javascript"> function create() { return $("<input>"); }
function write(args) { obj = $('#<%= OrdersGrid.ClientID %>').ejGrid('instance'); var dataManger = ej.DataManager({ /* OData service */ url: http://mvc.syncfusion.com/Services/Northwnd.svc/ }); /* Create Query */ var query = ej.Query().from("Orders").select("OrderID", "CustomerID", "EmployeeID");
var data = ej.DataManager(obj.model.dataSource).executeLocal(new ej.Query().select("OrderID", "CustomerID", "EmployeeID")); args.element.ejAutocomplete({ width: "100%", dataSource: data, query: query, multiColumnSettings: { enable: true, showHeader: true, stringFormat: "{0}", searchColumnIndices: [0, 1], columns: [ { "field": "CustomerID", "headerText": "CustomerID" }, { "field": "EmployeeID", "headerText": "EmployeeID" },
] },
fields: { key: "OrderID", text: "CustomerID" }, enableDistinct: true, value: args.rowdata !== undefined ? args.rowdata["CustomerID"] : "" }); }
function read(args) {
args.ejAutocomplete('suggestionList').css('display', 'none'); return args.ejAutocomplete("getValue"); } $(function () { $('#<%= OrdersGrid.ClientID %>').keyup(function (e) { if ( e.keyCode == 40 && $(e.target).hasClass("e-autocomplete")) { var gridid = $('#<%= OrdersGrid.ClientID %>').attr("id"); var autocomp = $("#" + gridid + "CustomerID").ejAutocomplete("instance") if (autocomp.getValue() != "" && autocomp.getActiveText() != "No suggestions") $(e.target).val(autocomp.getActiveText()); } }); }); </script> |
Please refer to the below sample,
https://www.syncfusion.com/downloads/support/directtrac/general/ze/Autocomplete2060991145
Please refer to the below screenshot,
Please refer the below demo,
http://asp.syncfusion.com/demos/web/grid/edittemplate.aspx
Please refer the below help documentation,
http://help.syncfusion.com/ug/aspnet/index.html#!Documents/edittemplate.htm
Kindly get back to us for further assistance.
Regards,
Pon selva