گروه بندی اطلاعات در jqGrid
نویسنده: وحید نصیری
تاریخ: ۱۳۹۳/۰۵/۰۴ ۰:۲۰
آدرس: www.dntips.ir
| مطالب | ۳۶۹۴ |
| نویسندگان | ۲۷۶ |
| گروههای مطالب | ۱۰۲۴ |
| نقشههای راه | ۱۱۹ |
| دورهها | ۱۴ |
| اشتراکها | ۱۷۹۱۴ |
namespace jqGrid10.Models
{
public class Post
{
public int Id { set; get; }
public string Title { set; get; }
public string CategoryName { set; get; }
public int NumberOfViews { set; get; }
}
}
$('#list').jqGrid({
caption: "آزمایش دهم",
//...
grouping: true,
groupingView: {
groupField: ['CategoryName'],
groupOrder: ['asc'],
groupText : ['<b>{0} - {1} ردیف</b>'],
groupDataSorted: true,
groupColumnShow: false,
groupCollapse: true,
groupSummary: [true],
showSummaryOnHide: true
}
}); colModel: [
// ........
{
name: '@(StronglyTyped.PropertyName<Post>(x => x.Title))',
index: '@(StronglyTyped.PropertyName<Post>(x => x.Title))',
align: 'right',
width: 150,
summaryTpl: '<div style="text-align: left;">خلاصه </div>',
summaryType: function (val, name, record) {
return "";
}
},
// ........
{
name: '@(StronglyTyped.PropertyName<Post>(x => x.NumberOfViews))',
index: '@(StronglyTyped.PropertyName<Post>(x => x.NumberOfViews))',
align: 'center',
width: 70,
summaryType: 'sum', summaryTpl: '<b>جمع مشاهدات: {0}</b>'
}
], $('#list').jqGrid({
caption: "آزمایش دهم",
//.........
loadComplete: function() {
//.........
$('#list').jqGrid('groupingToggle', 'list' + 'ghead_0_0');
$("tr.jqfoot td").css({
"background": "#2f4f4f",
"color": "#FFF"
});
},
});