Kendo ui 当存在多个标题行时,剑道网格分页不起作用
我也在剑道论坛上发布了这个问题,等待回复 我使用剑道网格进行ui和分页/排序工作,直到我在thead中添加多行(tr:2和tr:3)为止。我怎样才能解决这个问题?附近有路吗?我没有做任何分组,只是简单的行Kendo ui 当存在多个标题行时,剑道网格分页不起作用,kendo-ui,kendo-grid,Kendo Ui,Kendo Grid,我也在剑道论坛上发布了这个问题,等待回复 我使用剑道网格进行ui和分页/排序工作,直到我在thead中添加多行(tr:2和tr:3)为止。我怎样才能解决这个问题?附近有路吗?我没有做任何分组,只是简单的行 <table> <thead> <tr> <th data-field="firstname">First Name</th> <th
<table>
<thead>
<tr>
<th data-field="firstname">First Name</th>
<th data-field="surname">Surname</th>
<th>Class</th>
<th>Current Age</th>
@foreach (MapDetail geMapDetail in Model.mapDetails)
{
<th id=@geMapDetail.MapDetailID>Growth</th>
}
</tr>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
<!--get from mapdetails-->
@foreach (MapDetail geMapDetail in Model.mapDetails)
{
<th id="Year-Sem-Term">@geMapDetail.year</th>
}
</tr>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
<!--get from mapdetails-->
@foreach (MapDetail geMapDetail in Model.mapDetails)
{
<th>@geMapDetail.shortDescription</th>
}
</tr>
</thead>
<tbody></tbody>
<table/>
我认为网格不支持多个标题行(除了所谓的标题行),特别是当它是从现有表创建时。据我所见,在这种情况下会发生JavaScript错误 我的建议是在网格初始化之后在头中注入额外的表行。或者,您可以尝试使用多列标题,并且每个父列只有一个子列
html{字体大小:14px;字体系列:Arial、Helvetica、sans serif;}
汽车制造
汽车模型
年
类别
空调
沃尔沃汽车
S60
2010
轿车
对
奥迪
A4
2002
轿车
对
宝马
535d
2006
轿车
对
宝马
320d
2006
轿车
不
大众汽车
帕萨特
2007
轿车
不
大众汽车
帕萨特
2008
轿车
对
法国标致汽车
407
2006
轿车
对
本田
一致
2008
轿车
不
阿尔法罗密欧
159
2008
轿车
不
日产
阿美拉
2001
轿车
对
三菱
兰瑟
2008
轿车
对
欧宝
维克特拉
2008
轿车
对
丰田
爱文奇思
2006
轿车
不
丰田
爱文奇思
2008
轿车
对
丰田
爱文奇思
2008
轿车
对
奥迪
问题7
2007
运动型多用途汽车
对
现代
圣达菲
2012
运动型多用途汽车
对
现代
圣达菲
2013
运动型多用途汽车
对
日产
卡什凯
2007
运动型多用途汽车
对
梅塞德斯
B级
2007
掀背式汽车
对
兰西亚
地老虎
2006
掀背式汽车
对
$(文档).ready(函数(){
$(“#网格”).kendoGrid({
可排序:是的,
pageable:对,
数据源:{
页面大小:5
}
});
$(“#网格”).data(“kendoGrid”).thead.append('Row 2Row 2Row 2Row 2');
});
我所做的是将所有3/4行合并成一行,并用“br”标记隔开
名字
姓
等级
当代
@{
foreach(模型中的MapDetail geMapDetailHead.mapDetails)
{
字符串firstText、sectText、thirdText、fourthText;
//…在上述变量中设置所有4个标题行值
@firstText
@secText
@thirdText
@fourthText
}
}
同样的目的。您使用的是哪个版本的剑道UI?你可以在jsbin或其他web工具中重新创建它。如果你能做到这一点,只需给出示例链接。这对想帮助你的人来说太好了
$("#MapDetails").kendoGrid(
{
sortable: true,
dataSource: {
pageSize: 5
},
pageable:true,
resizable: true,
columns: [{
field: "firstname",
width: 150,
locked: false
}
]
}
);
<table class="table table-bordered table-striped table-bordered" id="MapDetails">
<thead>
<tr class="">
<th data-field="firstname">First Name</th>
<th data-field="surname">Surname</th>
<th data-field="class">Class</th>
<th data-field="age">Current Age</th>
@{
foreach (MapDetail geMapDetailHead in Model.mapDetails)
{
string firstText, secText, thirdText, fourthText;
//...set all 4 header row values in the above variables
<th id=@geMapDetailHead.MapDetailID>@firstText<br /><b>@secText</b><br />@thirdText<br /><font size="1">@fourthText</font></th>
}
}