cancel
Showing results for 
Search instead for 
Did you mean: 

Multi-Select Highlight Rule

leades
Moderator Moderator
Moderator

Hello,

Below are the steps to create a highlight rule from a multiselect dropdown list.

1. Have the viewstate for the dropdown list be of type list

leades_2-1641818560531.png

2. Create a virtual datasource with the following code to change the selected viewstate to a different format

function (list, callback) {

  var toReturn = {
    columns: ["Syntax", "Search"],
    meta: { Syntax: 11, Search: 11 },
    rows: [ { Syntax: "Syntax", Search: list.join(" OR ") }]
  }

  callback(toReturn);
}

 3. In this virtual datasource, set the list as the "selected" viewstate, and the value of the output to a new viewstate of type symbol

Virtual Correct Syntax.png

correctSelected viewstate.png

 4. Now create your highlight rule on the data grid with condition operator "search" and using the "correctSelected" as condition value

Highlight Rule.png

 Now you should be able to highlight multi rows in a data grid from a drop down list

leades_3-1641819669485.png

Feel free to suggest improvements below.

Many Thanks

Luke

 

 
1 ACCEPTED SOLUTION

LeahS
Moderator Moderator
Moderator

Super @leades  🙌

Confirming that this is the accepted solution when creating a highlight rule from a multiselect dropdown list.

Happy Coding 💻

Leah 

View solution in original post

1 REPLY 1

LeahS
Moderator Moderator
Moderator

Super @leades  🙌

Confirming that this is the accepted solution when creating a highlight rule from a multiselect dropdown list.

Happy Coding 💻

Leah