Author Topic: How to Add Confirm and Cancel Buttons in a Dropdown and Retrieve Their States?  (Read 1259 times)

cui

  • Newbie
  • *
  • Posts: 11
    • View Profile
Hi everyone,

I would like to enhance the functionality of my dropdown filter. Specifically, I want to add Confirm and Cancel buttons within the dropdown menu. The goal is to allow users to make their selections and then either confirm these changes or cancel them without applying any filters.

What I Need Help With:
Adding Buttons: How can I add Confirm and Cancel buttons inside the dropdown filter?
Retrieving Button States: Once added, how do I capture the state (which button was clicked) when a user interacts with these buttons?
Closing the Dropdown: After a button is clicked, how can I ensure that the dropdown closes automatically?
Code: [Select]
{
    title: '颜色编码',
    dataIndx: 'ColorCode',
    align: 'center',
    filter: {
      crules: [{ condition: 'range' }],
      selectGridObj: createSelectGridObj('ColorCode'),
    },
    filterFn(ui) {
      if (ui.condition == 'range') {
        return {
          attr: "placeholder='请选择' readonly",
        }
      }
    },
  },
Any guidance on how to implement this feature or links to relevant documentation/examples would be greatly appreciated. If there's already a built-in method or configuration option for this, please let me know as well.

Thank you in advance for your help!
Best regards