Our state of the art Gantt chart


Post by prabhakaran.r »

Hi
Am using the below code to get the user selected value from combo and calling sort

{
          type: "combo",
          label: "Sort By",
          editable: false,
          width: "20em",
          displayField: "name",
          value: 0,
          store: {
            data: [
              {
                id: 0,
                name: "-Select-",
              },
              {
                id: 1,
                name: "Name",
              },
              {
                id: 2,
                name: "Feature",
              }
            ],
          },
          listeners: {
            select(event) {
              console.log(event.record.name.toLowerCase());
              this.gantt.taskStore.sort({ field : event.record.name.toLowerCase(), ascending : false })
            },
          }
        }

I'm getting
"Uncaught TypeError: Cannot read properties of undefined (reading 'taskStore')"


Post by marcio »

Hey prabhakaran.r,

this will be related to Combo context, so won't have a gantt property. You can access the Gantt by checking the parent property.

this.parent

If that doesn't work out, please create a sample with your configuration and we can assist you better with how to get the gantt reference there.

Best regards,
Márcio


Post Reply