Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3668

select first item in list issue

$
0
0

Hi All,

 

While i navigate from detail1  page to another master2-detail2 page , i have to select first record in master2 by default while laoding master2-detail2.

 

but it is not working and no error in console also.

 

below is my code for default selection.

 

in master2 controller and in onInit() method i have written code as below.

 

this.waitForInitialListLoading(function() {

  //On the empty hash select the first item

  this.selectFirstItem();

  });

 

 

waitForInitialListLoading: function(fnToExecute) {

  jQuery.when(this.oInitialLoadFinishedDeferred).then(jQuery.proxy(fnToExecute, this));

  },

 

selectFirstItem: function() {

  var oList = this.getView().byId("list2");

  var aItems = oList.getItems();

  if (aItems.length) {

  oList.setSelectedItem(aItems[0], true);

  }

  },

 

 

please help

 

Regards,

Vamsi


Viewing all articles
Browse latest Browse all 3668

Trending Articles



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