0
내가, 내가 기대 행을 선택하고 편집 버튼을 클릭jqGrid 탐색 버튼은 게시 방법을 실행 했습니까?
가져 오기 방법
[HttpGet]
public ActionResult EditAuthor(int authorId)
포스트 방법
[HttpPost]
public ActionResult EditAuthor(AuthorViewModel model, HttpPostedFileBase file)
내 컨트롤러에이 방법을
$(document).ready(function() {
$("#grid").jqGrid({
url: '@Url.Action("GetAllAuthors", "Admin")',
datatype: "json",
mtype: 'get',
colNames: ['Yazar Adı', 'Öz Geçmiş'],
colModel: [
{ name: 'Name', index: 'Name', editable: false },
{ name: 'Description', index: 'Description', editable: false }
],
jsonReader: {
repeatitems: false,
id: "sno",
root: "rows", //array containing actual data
page: "page", //current page
total: "total", //total pages for the query
records: "records", //total number of records
repeatitems: false
},
rowNum: 10,
rowList: [10, 20, 30, 40, 50],
pager: jQuery('#gridpager'),
sortname: 'Name',
viewrecords: true,
sortorder: "asc",
width: 710,
height: 300
})
.navGrid('#gridpager', { edit: false, add: false, del: false, search: false, refresh: false })
.navButtonAdd('#gridpager', {
caption: "Düzenle",
buttonicon: "ui-icon-pencil",
onClickButton: function() {
var grid = $("#grid");
var rowid = grid.jqGrid('getGridParam', 'selrow');
//alert(rowid + " - " + grid.jqGrid('getCell', rowid, 'CustomerName') + " - Link: " + $("#customers_grid_table a.customer_details").attr("href"));
window.location = '@Url.Action("EditAuthor", "Admin")?authorId=' + rowid;
//LoadAction('@Url.Action("EditAuthor", "Admin")?authorId=' + rowid);
}
}); //end jqgrid
});
을있는 jqGrid 메서드를 호출하지만 post 메서드가 실행됩니다. 어떻게하면 화재를 일으킬 수 있습니까?
감사합니다.
나는 방법을 게시하고 싶지 않다. 나는 방법을 원해. 코드를 제안 사항으로 변경했습니다. 그러나 여전히 방법을 게시하십시오. –
또한 감사합니다. 나는 그들을했다. –
나는 sory, jqGrid에 관한 것이 아니다. 내 모델 유형에 관한 것. 고마워. –