我是jquery和jqgrid的新手。我使用ASP.NET WebForms。我能夠獲得一些數據舞臺服務器並在網格中顯示它。我使用PageMethods
從服務器獲取數據。通常我的代碼是jqGrid - 編輯數據
function CreateGrid(){
$("#sestGrid").jqGrid({
datatype: GetData,
//toolbar: [true, "top"],
colNames: ['Name', 'Age'],
colModel: [
{ name: 'Name', index: 'Name', width: 170, align: 'left',
sortable: false, key: true },
{ name: 'Age', index: 'Age', width: 40, align: 'center',
sortable: false, editable: true },
],
ondblClickRow: function() {
var row_id = $("#sestGrid").getGridParam('selrow');
$('#sestGrid').editRow(row_id, true);
}
});
}
function GetData() {
PageMethods.GetSestevalniStevecData(GotData);
}
function GotData (data) {
$("#sestGrid").clearGridData(false);
for (var j = 0; j <= data.length; j++)
$("#sestGrid").jqGrid('addRowData', j + 1, data[j]);
}
所以,現在我想編輯一些數據並將其發佈到服務器。我怎樣才能使用PageMethods
?我應該使用其他方法嗎?
還有一件事。我檢查了演示http://trirand.com/blog/jqgrid/jqgrid.html,並且在所有編輯示例中,您只能編輯一行,然後必須保存更改......是否可以編輯多行並將所有更改保存在一個步驟中?
謝謝大家。
奧列格,感謝您的答覆! 你的文章幫助我提高了我的jqgrid知識。 因此,如果我確定每行都在編輯後發佈到服務器。是否可以編輯幾行並通過單擊一個按鈕將它們全部發布到服務器? – user521379 2010-11-27 20:04:40