2013-12-12 54 views
0

JsOnStore編碼JSonStore錯誤與d.read

Ext.define('RouteSeqModel', { 
     extend: 'Ext.data.Model', 
     fields: [{name: '_id', type: 'number'}, 'Route_Seq','Location_Name'] 
    }); 

    var RouteSeqStore = Ext.create('Ext.data.JsonStore', { 
     model: 'RouteModelSeq', 
     autoLoad: false, 
     proxy: { 
      type: 'ajax', 
      url: 'get-routeseq.php', 
      api: { 
        create: 'insert-routeseq.php', 
        //read: 'http://visual04/ModuleGestion/php/Pays.php?action=read', 
        update: 'update-routeseq.php', 
        //destroy: 'http://visual04/ModuleGestion/php/Pays.php?action=destroy' 
       }, 
      actionMethods: 'POST', 
      extraParams: { 
        '_id' : '0', 
       }, 
      reader: { 
       type: 'json', 
       //idProperty: '_id' 
      }, 
      writer: { 
       type: 'json', 
       //id: '_id' 

      } 
     } 
    }); 

這是在組合框選擇時改然後傳遞extraparams來獲取數據,並顯示在網格面板

xtype: 'combobox', 
        width: 191, 
        store: RouteNameStore, 
        displayField : "Route_Code", 
        fieldLabel: 'Route Code', 
        labelWidth: 70, 
        allowBlank: false, 
        editable: false, 
        listeners: { 
            select: function(combo, records, eOpts) { 
            console.log("Combo selected _id : "+records[0].get('_id')); 
            RouteSeqStore.load({ 
               params:{ 
                _id: records[0].get('_id') 
               } 
              }); 
            } 
           } 

和Get-routeseq .PHP獲得做工精細,這是螢火返回JSON數據從GET-routeseq.php

[{"Route_ID":"1","Route_Seq":"1","Route_LocationID":"1","_id":"1","Location_ID":"1","Location_Name":"TRY","AddBy_ID":"2"}, 
{"Route_ID":"1","Route_Seq":"2","Route_LocationID":"2","_id":"2","Location_ID":"2","Location_Name":"ABC","AddBy_ID":"2"}] 

所有工作正常,但與此錯誤

TypeError: d.read is not a function 


...f(p==k){if(a+E+l.width>(O>=0?u.x+u.width-b:b-u.x)){p=M}}else{if(a+E>l.width){p=k... 

爲什麼螢火蟲?

+0

當我有一個錯誤我想不出我嘗試運行在兩種瀏覽器相同的應用程序(Chrome和Firefox)通常錯誤訊息是不同的,並提供有關的更多信息什麼可能是錯的。 –

+0

我還試圖通過獨立加載商店來驗證它是否正確加載,以確定問題是否存在於商店或組合定義中,以便找出問題。 –

回答

1

更換model: 'RouteModelSeq',

model: 'RouteSeqModel',