mel_lisau

mel_lisau

  • NA
  • 169
  • 0

How can i set the displayProp of a options in AngularJS to be a combin

May 1 2022 7:08 AM

How can I set the display text for my drop down to b a combination of my ItemText and ItemValue

The list that i bind to the ng-dropdown , ngObjList is a KeyValuePair.


     <div id="myObj"
                         ng-dropdown-multiselect=""
                         selected-model="myObj"
                         extra-settings="myObjSettings"
                         options="myObjList"
                         translation-texts="myObjCustomText"
                         ng-dropdown-multiselect-disabled="myObjDisabled"
                         events="myObjtEvents"></div>
                </div>


     $scope.myObjSettings = {
        enableSearch: true,
        scrollable: true,
        scrollableHeight: '300px',
        smartButtonMaxItems: 1,
        selectionLimit: 1,
        externalIdProp: '',
        displayProp: 'ItemText' + ' ' + 'ItemValue' , <--- that doesnt work 
        idProp: 'ItemValue',
        showCheckAll: false,
        showUncheckAll: false,
        closeOnSelect: true
    };


Answers (2)