How do I set the order of drop-down menus with cascading columns - Part2

How do I set the order of drop-down menus with cascading columns - Part2

Noodles12Noodles12 Posts: 107Questions: 38Answers: 2

Hi,

This relates to the question I posted yesterday: "How do I set the order of drop-down menus with cascading columns?".

Kevin's response was correct, but I also saw another issue. When I choose a name, such as Ashton, and then the related position, I am still given the option to choose another name, such as Test1 or Garrett. Changing the name causes the cascading to break down.

When I choose a Name, the behavior should be to simply keep that choice and prevent the user from selecting any other option in the Name column (just like other drop-downs). similar to https://live.datatables.net/yamifera/9/edit. Note that the values in this example are taken directly from a datatable.

Is this possible?

Here is my code -
https://live.datatables.net/yamifera/14/edit

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,723Questions: 1Answers: 10,108 Site admin

    Unfortunately, that isn't how SearchPanes' cascade works at the moment. I agree that it isn't intuitive, and it should be changed. It will be - but I'm not yet certain when!

    Allan

  • Noodles12Noodles12 Posts: 107Questions: 38Answers: 2

    Thanks. Is there a way to disable the values on the Name column if one value is selected? Enable only when user selects Reset Filter?

  • allanallan Posts: 61,723Questions: 1Answers: 10,108 Site admin

    Sorry - no for that as well. It is always enabled.

    Allan

  • kthorngrenkthorngren Posts: 20,309Questions: 26Answers: 4,769
    Answer ✓

    Allan, This is not with SearchPanes.

    You can get the currently displayed names using the same technique as the regular loop that builds the select list, for example column.data().unique(). Chain toArray() to make it a Javascript array. Then check to see if the hard coded name is in the column.data().unique() array. For example:
    https://live.datatables.net/yamifera/16/edit

    Kevin

  • allanallan Posts: 61,723Questions: 1Answers: 10,108 Site admin

    Oh! Sorry about thank, and that's for the correction Kevin. I saw "cascade" and jumped to a conclusion. That's what I get for rushing on a Friday.

    Allan

  • Noodles12Noodles12 Posts: 107Questions: 38Answers: 2

    No problem Allan. Thankyou Kevin very much!!!

Sign In or Register to comment.