Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8990

Re: Getting Unique values to dropdown list from table

$
0
0

Hi Jayasree.

 

In my point of view, the easier way to handle this is to create a model from the original Model like this

 

var stateModel = new sap.ui.model.json.JSONModel();

 

// attached request complete to the oData model and construct a new model

oData.attachRequestCompleted(function() {

     var data = this.getData()['d']['results'];

     var states = $.map(data, function(v, i) {

         return {name: v.state}; // assuming state is the attribute

     });

     stateModel.setData(states);

});

 

dropDownBox.bindItems('stateModel>/', new sap.ui.core.ListItem({

   key: 'stateModel>name',

   text: 'stateModel>name',

}));

 

dropDownBox.setModel(statModel, 'stateModel');

 

-D


Viewing all articles
Browse latest Browse all 8990

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>