Our pure JavaScript Scheduler component


Post by kundansah »

I am trying to add on change and filter function on combo, but when I am trying to achieve this only only function is getting triggered, like if filter function is working onchange function is not working. Can i get resolution on this.

here is the sample code what i am using

let filterConfig = {
    filterField: {
      type: "combo",
      value: activeCenterName,
      valueField: "name",
      displayField: "name",
      multiSelect: false,
      editable: false,
      store: resourceStoreInstance.chain(
        (record) => record.resourceType == "building"
      ),
      //onChange : refreshOnCenterChange,
      //
    },
    filterFn: ({ record, value }) => record.buildingName == value,
  
//onChange:refreshOnCenterChange };

Post by tasnim »

Hi,

Can you please show the whole config where are you applying this combo? Would it be possible to share a video of reproducing this issue?


Post by kundansah »

I am unable to add any attachment and gives HTTP error when trying to add files.


Post by kundansah »

please find attached video as zip attachment


Post by tasnim »

Hi,

Still do not see any attachments. If that isn't working you can share a Goggle drive link with us


Post by kundansah »

. Below image shows our combo filter

combo filter img1.png
combo filter img1.png (78.14 KiB) Viewed 461 times

.here on change of fields calendar booking data dates should load relevant to the field which we selected.
attached image below for your reference.

combo filter img2.png
combo filter img2.png (62.7 KiB) Viewed 461 times

. So when we select field we need data relevant data in down combo with for particular field reservations as shown in below image

combo filter 3.png
combo filter 3.png (15.58 KiB) Viewed 461 times

. so we are using below code to work both functionalities one is filterfn and onchnage property but while using below code only one functionality is working

let resourceStoreInstance = Store.getStore("resources");
  let { activeCenterName } = context;
  //resourceStoreInstance.sort("name"); //sort all resources alphabetically in combo //!!(+ list?) /// This is causing the re-sort

  let filterConfig = {
    filterField: {
      type: "combo",
      value: activeCenterName,
      valueField: "name",
      displayField: "name",
      multiSelect: false,
      editable: false,
      store: resourceStoreInstance.chain(
        (record) => record.resourceType == "building"
      ),
      //onChange : refreshOnCenterChange,
      //
    },
    filterFn: ({ record, value }) => record.buildingName == value,
  
onChange:refreshOnCenterChange }; return filterConfig; }

Post by kundansah »

tasnim wrote: Tue Mar 05, 2024 6:36 am

Hi,

Still do not see any attachments. If that isn't working you can share a Goggle drive link with us

Can you please review the screenshots and help me with the issue


Post by tasnim »

Hi,

Sorry, I'm still not sure what issue you're having when you select an item from the combo it does filters out the result. What is your expectation for that? can you please rephrase the issue that you're having?


Post by kundansah »

I want to execute a custom on change function on combo value change along with filtering the grid. By default I am able to get either one work


Post by alex.l »

Hi,

I want to execute a custom on change function on combo value change along with filtering the grid. By default I am able to get either one work

You basically need to use events, or call 2 methods one by one inside onChange handler.
https://bryntum.com/products/gantt/docs/api/Core/widget/Combo#event-change

combo.on('change', this.firstHandler);
combo.on('change', this.secondHandler);

All the best,
Alex


Post Reply