title: How to get unique/Distinct data from store?
body: <p>i am using the extjs. i need to retrieve distinct data from store as per requirement. <strong>In my store contains single list not nested list</strong> in that have regions like AMERICAS , North Sea and SE Asia. these region it self have subRegion,vesselName and vesselType values. I need to retrive unique value based on region, bacasue it contains many duplicate records. I have tried like as below, but it is not working me. <strong>Can anybody tel me how to achieve ?</strong>. great appreciated. Thank you.</p>
  
  <pre><code>var vesselStore=Ext.getStore('VesselStatusReportStore');
          var arr=new Array();
          var obj;      
          vesselStore.each(function(rec,index)
          {
              obj=new Object();
              if(rec.get('region')=='AMERICAS'){
                  obj.subRegionAmerica=rec.get('subRegion');
                  obj.vesselNameAmerica=rec.get('vesselName');
                  obj.vesselTypeAmerica=rec.get('vesselType');
              }
              if(rec.get('region')=='NorthSea'){
                  obj.subRegionNorthSea=rec.get('subRegion');
                  obj.vesselNameNorthSea=rec.get('vesselName');
                  obj.vesselTypeNorthSea=rec.get('vesselType');
              }
              if(rec.get('region')=='SE Asia'){
                  obj.subRegionSEAsia=rec.get('subRegion');
                  obj.vesselNameSEAsia=rec.get('vesselName');
                  obj.vesselTypeSEAsia=rec.get('vesselType');
              }
              arr.push(obj);
              console.log(obj);
          });
  </code></pre>
  
  <p>Json: </p>
  
  <pre><code>[ { 
      "region" : "AMERICAS",
      "startDate" : null,
      "subRegion" : "US",
      "vesselName" : "Thoma-Sea Ã?Â Hull #147",
      "vesselType" : "PSV"
    },
    { 
      "region" : "AMERICAS",
      "startDate" : null,
      "subRegion" : "US",
      "vesselName" : "Thoma-Sea Ã?Â Hull #148",
      "vesselType" : "PSV"
    },
    { 
      "region" : "AMERICAS",
      "startDate" : null,
      "subRegion" : "Mexico",
      "vesselName" : "Thoma-Sea Ã?Â Hull #148",
      "vesselType" : "PSV"
    }]
  </code></pre>