2016-02-16 27 views
0

我正在使用jqGrid。這裏是我的削減版的網格代碼:爲什麼我的網格使用GET,如果我將mType設置爲POST?

$("#users").jqGrid({ 
    datatype: 'json', 
    url: 'AjaxProxy.cfm', 
    mType: 'POST', 
    gridview: true, 
    colModel: [ 
     {name: 'lastname', label: 'Last Name'}, 
     {name: 'firstname', label: 'First Name'}, 
     ... more columns ... 
     ], 
    height:'auto', 
    autowidth:true, 
    caption:'Users', 
    rowNum:20, 
    rowList:[10,20,50], 
    sortorder:'asc', 
    sortname: 'lastname', 
    ignoreCase: true, // case-insensitive filtering 
    pager: '#pager', 
    jsonReader: { 
     root: "ROWS", //our data 
     page: "PAGE", //current page 
     total: "TOTAL", //total pages 
     records:"RECORDS", //total records 
     cell: "", //not used 
     id: "0" //will default first column as ID 
    }, 
    postData: postData 
}); 

我最近在mType: 'POST'增加。但是,當我在AjaxProxy.cfm文件中輸出request_method時,它指示它使用GET,並且所有的網格參數都在URL中傳遞,而不是作爲POST值傳遞。 Firebug和Chrome開發者工具也表明它正在使用GET。爲什麼它仍然使用GET?

回答

1

存在mType選項,只有mtype。所有名稱在JavaScript中都區分大小寫。使用

mtype: 'POST' 

應該解決你的問題。

+0

@froadie:不客氣!問題:人們可以看到其他更容易的錯誤,如他自己的錯誤。所以我們是人民。 – Oleg

相關問題