Hallo I will use the autocomplete to Pick data vom a json string. but always the value in the Textbox after Click is "undifind".
Html.EJ()
.Autocomplete("Antwort")
.Datasource(d => d.URL(Url.Action("Lookup", "Data"))
.Adaptor(AdaptorType.UrlAdaptor))
.Query("ej.Query()")
.AutocompleteFields(field => field.Key("DataRecord.Id").Text("DataRecord.DisplayName"))
.Width("300")
.FilterType(FilterOperatorType.Contains)
.WatermarkText("CRM Daten")
.MultiColumnSettings(obj => obj.Enable(true)
.Columns(obj1 =>
{
obj1.Field("Columns.Name").HeaderText("Entität").Add();
obj1.Field("LogicalName").HeaderText("LogischerName").Add();
})
.ShowHeader(true)
)
.MinCharacter(3)
.ShowPopupButton(true)
.MultiSelectMode(MultiSelectModeTypes.None)
.Render();
Result From Controller:
[
{
"DisplayName": "Kundenobjekt",
"LogicalName": "xxz_standort",
"Columns": {
"Objektart": "",
"Name": "Anmietung Dachstandort Musterhausen - Adlerstraße. 34-36",
"Ort": "",
"PLZ": "",
"Straße 1": ""
},
"DataRecord": {
"Id": "1aef2105-a58c-e711-80eb-3863bb352d80",
"LogicalName": "xxz_standort",
"DisplayName": "Anmietung Dachstandort Musterhausen - Adlerstraße. 34-36",
"RecordLink": "https://xxz.crm4.dynamics.com/main.aspx?etn=xxz_standort&pagetype=entityrecord&id=1aef2105-a58c-e711-80eb-3863bb352d80"
}
},
]
a Secend Question
is it Possible the Key set to a string like "DataRecord.LogicalName + ':' + DataRecord.Id"