AnsweredAssumed Answered

Dynamically updating dropdown options

Question asked by Will Will on Sep 10, 2014
Latest reply on May 6, 2015 by Dhaivat Naik
I'd like to be able to remove some options from a dropdown based on when another field on the view is updated. I've been able to extend the relate field and add in logic to grab the new options that I want to be shown in the dropdown field, but how can i have it render?

  This is what I have in my relate field code in the setValue() function. The data.loan_products_c field contains the options in the dropdown I want to keep, so I iterate through the existing list and remove those that are not in the loan_products_c field: 
  console.log(app.lang.getAppListStrings('loan_products_list'));  var new_options = app.lang.getAppListStrings('loan_products_list');  //console.log(new_options);  Object.keys(new_options).forEach(function(key) {       if(key == "") { return; }       if($.inArray(key, data.loan_products_c)== -1) {            delete new_options[key];       }  });  console.log(new_options);  var f = app.controller.layout.model.fields[self.filterMaps[o.field]];  f.options = new_options;