Premium support for our pure JavaScript UI components


Post by galb@control.site »

{
        type: 'resourceassignment',
        text: t('gantt_activity')!,
        itemTpl: ({ resourceName }: { resourceName: string }) => resourceName,
        editor: {
          picker: {
            unitsColumn: { hidden: true },
          },
          multiSelect: false,
          chipView: {
            itemTpl: ({ resourceName }: { resourceName: string }) =>
              resourceName,
          },
        },
      },

while trying to add multiSelect: false, the functionality works, but i dont see the label of the selected resource. and when clicking again im getting TypeError: assignments.forEach is not a function


Post by tasnim »

Hi,

Are you able to reproduce it here https://bryntum.com/products/gantt/examples/advanced/? Could you please share a reproduction video of this (I'm not seeing the error in the console, maybe I missed something)?


Post by galb@control.site »

https://www.bryntum.com/products/gantt/examples/resourceassignment/
here - try to add this:

columns                 : [
        { type : 'name', field : 'name', text : 'Name', width : 250 },
        {
            type        : 'resourceassignment',
            width       : 250,
            showAvatars : true,
            editor      : {
                type   : AssignmentField.type,
multiSelect: false,
                picker : {
                    height   : 350,
                    width    : 450,
                    features : {
                        filterBar  : true,
                        group      : 'resource.city',
                        headerMenu : false,
                        cellMenu   : false
                    },
                    // The extra columns are concatenated onto the base column set.
                    columns : [{
                        text       : 'Calendar',
                        // Read a nested property (name) from the resource calendar
                        field      : 'resource.calendar.name',
                        filterable : false,
                        editor     : false,
                        width      : 85
                    }]
                }
            }
        }

it breaks it


Post by tasnim »

Hi,

Thanks for providing the steps to reproduce the issue. We'll investigate it. Here is the ticket to track progress https://github.com/bryntum/support/issues/8632

Best regards,
Tasnim


Post by nickolay »

The multiSelect config of the AssignmentField (which is inherited from the combo box) is not applicable in this case. AssignmentField does not render a list items, like combo box. Instead, it completely replaces the combo's picker with the custom widget - AssignmentPicker which is a grid.

So using multiSelect is not supposed to work, you need to use a different approach. What are you trying to implement?


Post by galb@control.site »

i want to allow the user to pick only one resource.


Post by mats »

This is showcased here, did you see this demo? https://bryntum.com/products/gantt/examples/single-assignment/


Post Reply