I am trying to assign an array for the source to display in dropdown using vueJS. But I am getting error.
hotSettingsConfig: {
data:[
{ state: ‘All State’, bid: 52, enabled: ‘yes’ },
{ state: ‘DC’, bid: 0, enabled: ‘no’ },
{ state: ‘’, bid: ‘’, enabled: ‘no’ },
],
maxRows: 52,
minRows: 1,
colHeaders: [‘State’, ‘Bid’, ‘Enabled’],
columns: [
{
data: ‘state’,
type: ‘dropdown’,
source: this.getStates,
// source: [],
// renderer: function(instance, td, row, col, prop, value, cellProperties) {
// cellProperties.source = [‘abc’,‘All State’,‘DC’];
// },
validator: function(value, callback) {
var data = this.instance.getDataAtCol(this.col);
var index = data.indexOf(value);
if (index > -1 && this.row !== index) {
callback(false); // uniqueValue = false;
} else {
callback(true);
}
},
}
}
//computed property
computed: {
getStates() {
let states = this.partnerStates.map(function (obj){return obj.stateCode})
return states;
},
}