Page 1 of 1

Task edit modal resource field to be typeahead

Posted: Fri Jun 14, 2024 5:50 am
by jintech

I want to make the resource field a typeahead where I can type 3 letters and the drop down list gets updated with the resources that match the entered string. And i need to make this field to select only one resource at a time and not multiple. The following is a reference of how i want the resource field to look like. How will i be able to do this?


Re: Task edit modal resource field to be typeahead

Posted: Fri Jun 14, 2024 8:34 am
by sergey.maltsev

Hi!

ResourceCombo natively supports filtering when you type.
If you want to get all matches, which includes any of the typed letters you may setup this config option
https://bryntum.com/products/scheduler/docs/api/Scheduler/widget/ResourceCombo#config-primaryFilter

In EventEdit you may configure Resource field widget

https://bryntum.com/products/scheduler/docs/api/Scheduler/feature/EventEdit#built-in-widgets

features : {
    eventEdit : {
        items : {
            // In our event editor, we'd like to match-any resource names
            // not just match from start.
            resourceField : {
                primaryFilter : {
                    operator : '*'
                }
            }
        }
    }
},
ResourceFilter.png
ResourceFilter.png (25.32 KiB) Viewed 287 times

You may try in this online demo (Open editor at the top right corner)

https://bryntum.com/products/scheduler/examples/basic/


Re: Task edit modal resource field to be typeahead

Posted: Fri Jun 14, 2024 8:45 am
by Animal

If you assign resources to events using a set of assignments in your data block, it will assume that you require multiple assignment:

assignments : {
  "rows": [
    {
      "id": 1,
      "eventId": 1,
      "resourceId": "a"
    },
    ...
  ]
}

If you don't want to change your data format to the inline resourceId in the event data, then you can configure the event store to only use single assignment:

https://bryntum.com/products/scheduler/docs/api/Scheduler/data/mixin/EventStoreMixin#config-singleAssignment

project : {
    eventStore : {
        singleAssignment : true
    }
}