Sunday, November 3, 2019

How to show multiple records with the same primary key in ExtJs Store. ------ Ext store primary key field unavailable

■ Keyword
Extjs Ext Javescript
Store
proxy idProperty
■ Issue
Data.items Data.items
ID NAME ID NAME
111 A111 111 A111
111 A222        
111 A333    
222 B222 222 B222
■ Solution
STEP①              
  Ext.define(modelName, {  
  extend : "Ext.data.Model",  
  fields : ["num",  
  proxy: {  
   
    type: 'ajax',  
    reader: {  
          type: 'json',  
          idProperty: 'undefined'}}  
                 
STEP②  
   
  store.add(data.items); store.loadRawData(data.items);
                 
idProperty will decide which field will be primary key.
Default is field:"ID".

1 comment:

digitalhts said...

Thank you for your post. This is excellent information. It is amazing and wonderful to visit your site.Otherwise if any one who want to learn tally core to advance contact us on 9311002620 and visit further website https://www.htsindia.com/Courses/tally/tally-training-course