强大的JQuery的插件jqGrid(8)
时间:2025-06-08
时间:2025-06-08
希望这个帮助文档能对大家学习jQuery的插件jqGrid带来帮助(在个人的使用过程中不断更新),希望大家提出意见。
<cell>sss</cell>
<cell>sss</cell>
</row>
<row>
<cell>sss</cell>
<cell>sss</cell>
<cell>sss</cell>
<cell>sss</cell>
<cell>sss</cell>
<cell>sss</cell>
<cell>sss</cell>
</row>
</rows>
</root>
如果xml格式发生变化,则xmlReader里的数据做相应修改即可。
page: "rows>page",
total: "rows>total",
records : "rows>records",
repeatitems: true,
这几行代码的作用在于,定义分页的条件,使页面正确显示数据和分页。最后一个repertitems是设置xml格式里的cell是否可以重复一样。
六、一些操作函数
jQuery("#grid_id").trigger("reloadGrid"); 刷新表格
jQuery("#grid_id").getGridParam('selarrrow'); 获取选择表格的id 多选的
jQuery("#grid_id").getGridParam('selrow'); 获取选中表格id 单选
//设置不可编辑的单元格被选中后触发的事件
onSelectCell:function(rowid,celname,value,iRow,iCol){
var gg= jQuery("#list").getGridParam("selrow");
var gr= jQuery("#list").getCell(gg,"N_DanJia");
if(gr<100){
N_DanJia:1000;
};
},
beforeSubmitCell : function(rowid,celname,value,iRow,iCol){
UserData:
在某些情况下,我们接受到从服务器端传递过来的数据并不会自动的被jqGrid展现的,这个时候我们要么在接下来对它进行处理,要么在html代码里进行额外说明,这个时候userdata这个标签就用到了。
xmlReader: {userdata: "userdata",... }
In the data received from the server, this could be structured as follows (in xml): <invoices> <request>true</request>
上一篇:初中美术教学计划
下一篇:重庆经济发展现状与未来[1]