我使用的是basicsgrid例如从这里:http://tpeczek.codeplex.com/releases/view/61796如何将editbutton添加到jqgrid?
尝试添加editbutton的每一行,所以我可以打开我的编辑页面,但不起作用?我错过了什么?
我加入这个在网格定义的结尾:
editurl: '/主页/编辑'
电网:
<script type="text/javascript">
$(document).ready(function() {
$('#jqgProducts').jqGrid({
//url from wich data should be requested
url: '@Url.Action("Products")',
//type of data
datatype: 'json',
//url access method type
mtype: 'POST',
//columns names
colNames: ['Actions', 'ProductID', 'ProductName', 'SupplierID', 'CategoryID', 'QuantityPerUnit', 'UnitPrice', 'UnitsInStock'],
//columns model
colModel: [
{ name: 'act', index: 'act', width: 55, align: 'center', sortable: false, formatter: 'actions' },
{ name: 'ProductID', index: 'ProductID', align: 'left' },
{ name: 'ProductName', index: 'ProductName', align: 'left' },
{ name: 'SupplierID', index: 'SupplierID', align: 'left' },
{ name: 'CategoryID', index: 'CategoryID', align: 'left' },
{ name: 'QuantityPerUnit', index: 'QuantityPerUnit', align: 'left' },
{ name: 'UnitPrice', index: 'UnitPrice', align: 'left' },
{ name: 'UnitsInStock', index: 'UnitsInStock', align: 'left' }
],
//pager for grid
pager: $('#jqgpProducts'),
//number of rows per page
rowNum: 10,
//initial sorting column
sortname: 'ProductID',
//initial sorting direction
sortorder: 'asc',
//we want to display total records count
viewrecords: true,
//grid height
height: '100%',
editurl: '@Url.Action("Edit")'
});
});
斗ü要广告d自定义按钮到每一行或默认情况下,也可以编辑按钮,你想使用它吗? – 2012-07-31 02:48:21
@PiyushSardana只是标准的编辑按钮简单和方便 – user603007 2012-07-31 03:00:20
检查我的答案然后..我链接我张贴 – 2012-07-31 03:01:16