无法将数据加载到'dijit / form / FilteringSelect'类型

时间:2018-09-05 17:47:50

标签: javascript dojo dijit.layout

我有这个代码

loadProducts: function(grid, rowData, newId){
    		return request.post(dojoConfig.urls.LOAD_PRODUCTS_SERVICES, {
    			handleAs: "json",
    			data: {accType: "Sales"}
    			}).then(lang.hitch(this, function(data){
    				data=data.data;
   
     			this.barcodeStore.setData(data);
			this.barcodeObjStore = new ObjectStore({objectStore: this.barcodeStore});
    			}))
    	},

this.barcodeStore = new Memory({idProperty: 'id', data: []});
this.barcodeObjStore = new ObjectStore({objectStore: this.barcodeStore});
        
var barcodeColumn = {
    				field: 'barcode', 
    				label: dojoConfig.i18n.barcode, 
    				className: 'hand',
    				editor: Select,
    				autoSave: true,
    				editorArgs: {
    	    	        searchAttr: 'barcode',
    	    	        labelAttr: "barcode",
    					style: 'width: 95%',
    					store: this.barcodeObjStore
    				}
        		};

    data in **loadProducts** method has this data

  0: {id: 638, name: "General Product", barcode: "12345", rate: "0.0"}
  1: {id: 639, name: "General Service", barcode: "asd1234, rate: "0.0"}
  2: {id: 689, name: "sadsa", barcode: "4567", rate: "543.0"}
  3: {id: 645, name: "product", barcode: "barfd", rate: "400.0"}

所以我的问题是如何将“条形码”数据加载到this.barcodeObjStore中? 任何帮助将不胜感激....对不起,因为我是道场的初学者

0 个答案:

没有答案