How to apply fewer options of drop down menu for specific rows of datatable?

Hi,

I have a datatable with a drop down column named ‘Color’.
The dropdown menu by default has four menu items as ‘green’, ‘yellow’, ‘red’ and ‘blue’.

I want if the name column has value as ‘Mark’ then only ‘green’ and ‘yellow’ value to be shown in the corresponding dropdown cell. However , I am getting an error to achieve it .

Snippet is here : https://snippet.webix.com/9307hv5j

Please help.

Thanks.

Hello @ovi_zit ,
You can use onItemClick which fires when the item was clicked

 on:{
    onItemClick(id){
      var config = this.getColumnConfig("id2");
      if(this.getItem(id.row).id1 == "Mark"){
        config.options=["green", "yellow"];
      }
      else{
        config.options=["green", "yellow", "red", "blue"];
      }
    }
  } 

Example: https://snippet.webix.com/jpk324ys

Thanks a lot!!! It worked cool.