Friday, 12 June 2015

How to get the specified property from Array using Extjs functions

Using the Ext.pluck we can get the specified property from  array of strings.


 var places = [  
  {name: 'Hyderabad', area: 'Hitechcity'},  
  {name: 'Secunderabad', area: 'ECIL'},  
  {name: 'RangaReddy', area: 'Chanda Nagar'}  
 ];  
 Ext.pluck(places, 'name'); //returns ['Hyderabad', 'Secunderabad', 'RangaReddy']  
 Ext.pluck(places, 'area'); //returns ['Hitechcity', 'ECIL', 'Chanda Nagar']  

No comments:

Post a Comment