Our state of the art Gantt chart


Post by cado1982 »

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
        },
    })
}

Post by Animal »

That is not a remotely filtered Combo. That is a combo which attempts to loads the full dataset from /App/SearchStaff upon instantiation. These are two distinct ways that a remote dataset can be used as a selectable resource.

To indicate that the remote service is to be sent a filter value, add this config: https://www.bryntum.com/products/scheduler/docs/api/Core/widget/Combo#config-filterParamName

If the filter values need no special encoding you do not need encodeFilterParams

The createOnUnmatched, option is a function, or function name which handles unmatched strings. You have to perform whatever operation needed to send some data back to the server to create that new entry in the table.

Do you run this with the Network debugger tab open to check when and what the Combo is sending and receiving?


Post Reply