[VUE 2] Combo box backed by AjaxStore in TaskEdit
Hello, I have a specific set of requirements that I need to implement for a combo box in the TaskEdit popup.
The combo box should allow typing a filter which is passed to a backend and presents a list of matching results. I have this part working.
An additional requirement that I'm struggling with is: If the user does not choose a value from the dropdown, they can still proceed and the text in the filter should be used as the accepted value. Essentially it's a free form text field that also provides suggestions from a backend server.
Here's what I have at the moment (this is the task edit field config), however I've tried lots of different combinations of settings on the combo box to no avail. It seems the block is because the AjaxStore doesn't add the unknown value to its store maybe but I don't really need it to do that because it's just a text field. Does anyone know how to accomplish this?
responsible: {
type: "combo",
weight: 200,
flex: '1 0 50%',
cls: 'b-inline',
name: "responsible",
label: "Responsible",
valueField: "staffName",
displayField: "staffName",
createOnUnmatched: true,
clearTextOnPickerHide: false,
validateFilter: false,
clearable: true,
placeholder: "Enter text or select a user",
store: new AjaxStore({
readUrl: '/App/SearchStaff',
filterParamName: 'searchTerm',
headers: {
TokenAuth: this.data.store.state.jwtStorage.jwt().httpHeader
},
encodeFilterParams: (filters) => {
return filters[0].value
},
})
}