2011-12-21 93 views
0
var gridStore = Ext.create('Ext.data.Store', { 
    model: 'Writer.Person', 
    autoLoad: true, 
    autoSync: false, 
    proxy: { 
     type: 'ajax', 
     api: { 
      read: '?operant=2', 
      create: '?operant=3', 
      update: '?operant=4', 
      destroy: '?operant=5' 
     }, 
     reader: { 
      type: 'json', 
      successProperty: 'success', 
      root: 'data', 
      messageProperty: 'message', 
      extraParams: { 
       user_id: "some text", 
       another_param: "more text" 
      } 
     } 
    } 
}); 

我試過使用baseParams,params,我用小提琴來看,extjs沒有發送這個,怎麼辦?感謝如何設置store.proxy的參數

回答

1

我相信你正在尋找extraParams,這是下一個proxy配置。例如:

proxy: { 
    url: "some_page.jsp", 
    extraParams: { 
     user_id: "some text", 
     another_param: "more text", 
     // add as many as you need 
    } 
} 

這些額外的參數將在您的請求中發送。還有一些由Ajax代理類設置的默認參數:pageParam, sortParam, groupParam, filterParam, limitParam。將這些設置爲undefined以將其從請求中刪除。