jqGrid:在将HTML表格转换为网格时启用分页 [英] jqGrid: Enable paging while converting HTML table to grid
问题描述
tableToGrid()
来转换表(我们将其作为jQuery选择器字符串传递给方法)。我也尝试了很多其他的东西,例如: tableToGrid('#GridView1');
$('#GridView1')。jqGrid({
rowNum:10,
pager:'#pager',
rowList:[10,20,30 ]
});
但所有这些都不能为我提供正确的结果。当我们将html表格转换为网格时,是否可以进行分页?
您应该尝试使用
tableToGrid('#GridView1',{
rowNum:10,
pager:'#pager',
rowList:[10 ,20,30]
});
您还可以添加更多jqGrid选项作为 然后修改列模型的一些参数。 更新:例如对于以下代码,您可以设置一些列数据为 Been googling all this while on how to convert an html table to something pagable and sortable, and I have stumbled across jqGrid jquery plugin. I've learned so far that we have to call But all these do not provide me with the proper result. Is paging possible when we convert an html table to grid? You should try with You can also add more jqGrid options as the second parameter of and then modify some parameters of the column model. UPDATED: for example with the following code you can set some column data as
这篇关于jqGrid:在将HTML表格转换为网格时启用分页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! tableToGrid 的第二个参数。 code>。对于
<$转换之后,您还可以获取引用到jqGrid的 colModel
p $ p> var cm = myGrid.getGridParam(colModel);
edittype:select
。
for(var i = 0,l = cm.length; i <1; i + = 1){
var colModelColumn = cm [i];
//搜索名称为colModelColumnName的clolumn。
//变量colModelColumnName和selectedOptions被定义
//在另一个代码片段之上
if(colModelColumn.name === colModelColumnName){
jQuery.extend(colModelColumn, {edittype:select,
editoptions:{value:selectedOptions}});
休息;
}
}
tableToGrid()
to convert the table (which we pass as a jquery selector string to the method). I've also tried a host of other things, like for e.g:tableToGrid('#GridView1');
$('#GridView1').jqGrid({
rowNum: 10,
pager: '#pager',
rowList: [10,20,30]
});
tableToGrid('#GridView1', {
rowNum: 10,
pager: '#pager',
rowList: [10,20,30]
});
tableToGrid
. You can also get reference to the colModel
of the jqGrid after conversion with respect of var cm = myGrid.getGridParam("colModel");
edittype: "select"
.for (var i = 0, l=cm.length; i < l; i += 1) {
var colModelColumn = cm[i];
// search for the clolumn with the name colModelColumnName.
// variables colModelColumnName and selectedOptions are defined
// in another code fragment above this one
if (colModelColumn.name === colModelColumnName) {
jQuery.extend(colModelColumn, { edittype: "select",
editoptions: { value: selectedOptions }});
break;
}
}