jqGrid 问题笔记 .
2013-01-20 21:09
127 查看
http://blog.csdn.net/alinaxz/article/category/845388
Loading...
Custom edit
<!--StartFragment-->jQuery("#rowed2").jqGrid({
url:'server.php?q=3',
datatype: "json",
colNames:['Actions','Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'act',index:'act', width:75,sortable:false},
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90, editable:true},
{name:'name',index:'name', width:100,editable:true},
{name:'amount',index:'amount', width:80, align:"right",editable:true},
{name:'tax',index:'tax', width:80, align:"right",editable:true},
{name:'total',index:'total', width:80,align:"right",editable:true},
{name:'note',index:'note', width:150, sortable:false,editable:true}
],
rowNum:10,
rowList:[10,20,30],
pager: '#prowed2',
sortname: 'id',
viewrecords: true,
sortorder: "desc",
gridComplete: function(){
var ids = jQuery("#rowed2").jqGrid('getDataIDs');
for(var i=0;i < ids.length;i++){
var cl = ids[i];
be = "<input style='height:22px;width:20px;' type='button' value='E' onclick=\"jQuery('#rowed2').editRow('"+cl+"');\" />";
se = "<input style='height:22px;width:20px;' type='button' value='S' onclick=\"jQuery('#rowed2').saveRow('"+cl+"');\" />";
ce = "<input style='height:22px;width:20px;' type='button' value='C' onclick=\"jQuery('#rowed2').restoreRow('"+cl+"');\" />";
jQuery("#rowed2").jqGrid('setRowData',ids[i],{act:be+se+ce});
}
},
editurl: "server.php",
caption:"Custom edit "
});
jQuery("#rowed2").jqGrid('navGrid',"#prowed2",{edit:false,add:false,del:false});
Loading...
Custom edit
Actions | Inv No | Date | Client | Amount | Tax | Total | Notes |
---|
13 | |||||||
12 | |||||||
11 | 2007-10-06 | Client 1 | 600.00 | 120.00 | 720.00 | ||
10 | 2007-10-06 | Client 2 | 100.00 | 20.00 | 120.00 | ||
9 | 2007-10-06 | Client 1 | 200.00 | 40.00 | 240.00 | ||
8 | 2007-10-06 | Client 3 | 200.00 | 0.00 | 200.00 | ||
7 | 2007-10-05 | Client 2 | 120.00 | 12.00 | 134.00 | ||
6 | 2007-10-05 | Client 1 | 50.00 | 10.00 | 60.00 | ||
5 | 2007-10-05 | Client 3 | 100.00 | 0.00 | 100.00 | no tax at all | |
4 | 2007-10-04 | Client 3 | 150.00 | 0.00 | 150.00 | no tax |
| View 1 - 10 of 13 |
url:'server.php?q=3',
datatype: "json",
colNames:['Actions','Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'act',index:'act', width:75,sortable:false},
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90, editable:true},
{name:'name',index:'name', width:100,editable:true},
{name:'amount',index:'amount', width:80, align:"right",editable:true},
{name:'tax',index:'tax', width:80, align:"right",editable:true},
{name:'total',index:'total', width:80,align:"right",editable:true},
{name:'note',index:'note', width:150, sortable:false,editable:true}
],
rowNum:10,
rowList:[10,20,30],
pager: '#prowed2',
sortname: 'id',
viewrecords: true,
sortorder: "desc",
gridComplete: function(){
var ids = jQuery("#rowed2").jqGrid('getDataIDs');
for(var i=0;i < ids.length;i++){
var cl = ids[i];
be = "<input style='height:22px;width:20px;' type='button' value='E' onclick=\"jQuery('#rowed2').editRow('"+cl+"');\" />";
se = "<input style='height:22px;width:20px;' type='button' value='S' onclick=\"jQuery('#rowed2').saveRow('"+cl+"');\" />";
ce = "<input style='height:22px;width:20px;' type='button' value='C' onclick=\"jQuery('#rowed2').restoreRow('"+cl+"');\" />";
jQuery("#rowed2").jqGrid('setRowData',ids[i],{act:be+se+ce});
}
},
editurl: "server.php",
caption:"Custom edit "
});
jQuery("#rowed2").jqGrid('navGrid',"#prowed2",{edit:false,add:false,del:false});
相关文章推荐
- jqGrid 问题笔记
- jqGrid 问题笔记
- SQL Server安装时COM+目录要求问题的解决(学习笔记)
- 学习笔记:cache 和spring cache 技术---本地缓存-分布式缓存,缓存穿透,雪崩,和热点key的问题
- STM32F10x 学习笔记9(解决JLink 无法下载程序的问题)
- BUG笔记:Win8 IE10下input[type="password"]内字符显示被截取问题
- Solr学习笔记之问题汇总
- CouchBase 遇到问题笔记(一)
- 算法学习笔记——利用栈解决实际问题- part 2
- selenium 学习笔记 ---新手学习记录(9) 问题总结(java)
- Java 学习笔记--解决一个类实现多个接口的问题
- iOS开发笔记3——IOS开发内存警告Memory Warning和ViewController的生命周期的问题
- Android笔记:百度地图与高德地图坐标转换问题
- 使用MPLAB遇到的问题及解决笔记
- HTML笔记——小TIP和格式问题
- 问题记录笔记
- Linux日知录(常用问题笔记)
- Solr学习笔记之问题汇总
- contiki学习笔记——cc2530dk例程实践和UDP重启问题解决