displayProp in extra-settings with multiple fileds
I currently have this settings for my dropdown:
$scope.attachDropdownSettings = {
enableSearch: true,
showCheckAll: false,
showUncheckAll: false,
displayProp: 'name',
scrollable: true,
scrollableHeight: 250,
idProperty: 'id',
};
I need to have multiple fields in the displayProp or to be more specific I need to take some value from another array of object and i need to have in displayProp an expression or a function like this:
$scope.attachDropdownSettings = {
enableSearch: true,
showCheckAll: false,
showUncheckAll: false,
displayProp: function(currentItem){
return anotherObject.value + " - " + currentItem.name;
},
scrollable: true,
scrollableHeight: 250,
idProperty: 'id',
};
Is it possible to do something like this in any way? I really need to do this.
@Planet910 : could it be an option for you to build a variable where you can dump everything you need?
let's say that you add to your options list a property called msDisplay:
const myList = fetch('your list here');
myList = myList.map(el=> Object.assign(el, {msDisplay: anotherObject.value + " - " + el.name}));
Then your dropdown could look like this:
<ng-dropdown-multiselect options="myList " ... />