加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 创业 > C语言 > 正文

group-grid-demo(求和、求平均...)参数配置说明

发布时间:2020-12-15 00:19:43 所属栏目:C语言 来源:网络整理
导读:table class="text" tr class="li1" td class="ln"pre class="de1"1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
<tr class="li1">
<td class="ln"><pre class="de1">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106

$dataProvider,? ? 'filterModel'=>$searchModel,? ? 'showPageSummary'=>true,? ? 'pjax'=>true,? ? 'hover'=>true,? ? 'panel'=>['type'=>'info','heading'=>'Group 例子'],//type:配置表单主题;heading:配置表头文字 ? ? 'columns'=>[ ? ? ? ? ['class'=>'kartikgridSerialColumn'],? ? ? ? [ ? ? ? ? ? ? 'attribute' => 't_company',? ? ? ? ? ? 'width'=>'300px',? ? ? ? ? ? 'noWrap'=>true,? ? ? ? ? ? 'contentOptions' => ['class'=>'kv-align-middle'],? ? ? ? ? ? 'format'=>'raw',? ? ? ? ? ? 'group'=>true,?// 打开关闭分组 ? ? ? ? ? ? // 'groupedRow'=>true,//按分组换行 ? ? ? ? ? ? // 'groupOddCssClass'=>'kv-grouped-row',?// 给组加class ? ? ? ? ? ? // 'groupEvenCssClass'=>'kv-grouped-row',// 给组下的元素加class ? ? ? ? ? ? // 'groupFooter'=>function ($model,$key,$index,$widget) { // 在组的底部显示分类统计 ? ? ? ? ? ? // ? ? return [ ? ? ? ? ? ? // ? ? ? ? 'mergeColumns'=>[[2,3]],// 字段行合并 ? ? ? ? ? ? // ? ? ? ? 'content'=>[ ? ? ? ? ? ? // content to show in each summary cell ? ? ? ? ? ? // ? ? ? ? ? ? 1=>'Summary (' . $model->t_company . ')',? ? ? ? ? ? // ? ? ? ? ? ? 4=>GridView::F_AVG,? ? ? ? ? ? // ? ? ? ? ? ? 5=>GridView::F_SUM,? ? ? ? ? ? // ? ? ? ? ? ? 6=>GridView::F_SUM,? ? ? ? ? ? // ? ? ? ? ],? ? ? ? ? ? // ? ? ? ? 'contentFormats'=>[ ? ? ?// content reformatting for each summary cell ? ? ? ? ? ? // ? ? ? ? ? ? 4=>['format'=>'number','decimals'=>2],? ? ? ? ? ? // ? ? ? ? ? ? 5=>['format'=>'number','decimals'=>0],? ? ? ? ? ? // ? ? ? ? ? ? 6=>['format'=>'number',? ? ? ? ? ? // ? ? ? ? 'contentOptions'=>[ ? ? ?// content html attributes for each summary cell ? ? ? ? ? ? // ? ? ? ? ? ? 1=>['style'=>'font-variant:small-caps'],? ? ? ? ? ? // ? ? ? ? ? ? 4=>['style'=>'text-align:right'],? ? ? ? ? ? // ? ? ? ? ? ? 5=>['style'=>'text-align:right'],? ? ? ? ? ? // ? ? ? ? ? ? 6=>['style'=>'text-align:right'],? ? ? ? ? ? // ? ? ? ? // html attributes for group summary row ? ? ? ? ? ? // ? ? ? ? 'options'=>['class'=>'danger','style'=>'font-weight:bold;'] ? ? ? ? ? ? // ? ? ]; ? ? ? ? ? ? // },? ? ? ? ? ? 'subGroupOf'=>5,// supplier column index is the parent group ? ? ? ? ? ? 'value' => function($model){ ? ? ? ? ? ? ? ? if(empty($model->t_company)){ ? ? ? ? ? ? ? ? ? ? return 't_id.' class="a-quick-sidebar-toggler">'.Yii::t('yii','Not company').''; ? ? ? ? ? ? ? ? } ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if(AccessAuthService::hasAuth('sales','view')){ ? ? ? ? ? ? ? ? ? ? return 't_id.' class="a-quick-sidebar-toggler">'.$model->t_company.''; ? ? ? ? ? ? ? ? }else{ ? ? ? ? ? ? ? ? ? ? ?return 't_company.''; ? ? ? ? ? ? ? ? } ? ? ? ? ? ? } ? ? ? ? ],? ? ? ? [ ? ? ? ? ? ? 'attribute'=>'t_tel',? ? ? ? ? ? 'width'=>'250px',? ? ? ? ? ? 'value'=>function ($model,$widget) { ? ? ? ? ? ? ? ? return $model->t_tel; ? ? ? ? ? ? },? ? ? ? ? ? 'filterType'=>GridView::FILTER_SELECT2,? ? ? ? ? ? ? ? ? ? ? ? 'filterWidgetOptions'=>[ ? ? ? ? ? ? ? ? 'pluginOptions'=>['allowClear'=>true],? ? ? ? ? ? ],? ? ? ? ? ? 'filterInputOptions'=>['placeholder'=>'Any category'],? ? ? ? ? ? 'group'=>false,?// enable grouping ? ? ? ? ? ? 'subGroupOf'=>1,// supplier column index is the parent group ? ? ? ? ? ? 'pageSummary'=>'统计',? ? ? ? ],? ? ? ? [ ? ? ? ? ? ? 'attribute'=>'t_status',? ? ? ? ? ? // 'mergeHeader'=>true,//合并表头 ? ? ? ? ? ? 'format'=>['decimal',2],//参数说明:[字段类型,保留小数点位数] ? ? ? ? ? ? 'hAlign'=>'right',//设置单元格内容左右的位置 ? ? ? ? ? ? 'pageSummary'=>true,? ? ? ? ? ? 'pageSummaryFunc'=>GridView::F_SUM,//列求和(pageSummaryFunc:不设置默认求和) ? ? ? ? ? ? 'pageSummaryOptions'=>['class'=>'text-right text-warning'],? ? ? ? [ ? ? ? ? ? ? 'attribute'=>'t_fenlei',? ? ? ? ? ? 'width'=>'150px',? ? ? ? ? ? 'hAlign'=>'right',? ? ? ? ? ? 'format'=>['decimal',? ? ? ? ? ? 'pageSummary'=>true,? ? ? ? ? ? 'pageSummaryFunc'=>GridView::F_AVG //列求平均 ? ? ? ? ],? ? ? ? [ ? ? ? ? ? ? 'class'=>'kartikgridFormulaColumn',? ? ? ? ? ? 'header'=>'Amount In Stock',$widget) { ? ? ? ? ? ? ? ? $p = compact('model','key','index'); ? ? ? ? ? ? ? ? // return $widget->col(4,$p) * $widget->col(5,$p); ? ? ? ? ? ? },? ? ? ? ? ? 'mergeHeader'=>true,? ? ? ? ? ? 'pageSummary'=>true ? ? ? ? ],? ? ],]); ??>(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

<table class="text">

    推荐文章
      热点阅读