Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
30
igx-combo editing combo data
posted

I am having trouble using igx-combo and I'll try to explain the scenario.

I have a combo component (combo B) where its data is variable and will change depending on what a user has selected in another combo component (combo A). For example, lets say there is a selection component containing genres such as fruits or vegetables (combo A). Upon selecting one of those options, the second combo component will display a list with that genre of items (combo B). If a user selects fruits in combo A, apples, oranges, bananas, etc. will show in combo B. 

Here is the bug that I am running into:

A user selects fruits in combo A to dictate the data that they will be able to select in combo B and closes the combo.

A user then opens the combo B dropdown and scrolls down in the list to select a fruit and closes the combo. 

A user changes their mind and selects vegetables in combo A. This will change the data being displayed in combo B.

When a user tries to open and select something in combo B, the combo dropdown does not display the correct data and has blanks in the dropdown. The scroll bar is also gone. 

 

I think what is happening is if the two genres of data have a varied length, such as 50 fruits and 100 vegetables in the list, and the user scrolls down to anywhere past the 50th item mark in vegetables, if they switch back to fruits, the scroll bar becomes past the max item length and breaks. 

Is there any fix for this?

Parents
  • 1560
    Offline posted

    Hello,


    I have been looking into your question and prepared a small sample based on the provided details. On my side, everything seems to work as expected and I'm able to successfully change and display the correct data.


    In order to change the data in the second combo based on the selected item in the first one, I'm handling the onSelectionChange event.

    public changeComboSelection(event) {
        this.comboB.deselectAllItems();
        this.dataB = [];
        if (event.added && event.added.length > 0) {
          event.newSelection = [event.added[0]];
          if (event.added[0] === "fruits") {
            this.dataB = this.fruits;
          }
          if (event.added[0] === "vegetables") {
            this.dataB = this.vegetables;
          }
        } else {
          event.newSelection = [];
        }
      }


    Here could be found my sample for your reference. Please test it on your side and let me know if I may be of any further assistance.

    Sincerely,
    Teodosia Hristodorova
    Associate Software Developer

Reply Children