@@ -42,5 +42,120 @@ export class BasicUse {
42
42
this . myGrid . ctx . showOnlyNotSelected ( ) ;
43
43
}
44
44
45
+ setColumns ( ) {
46
+ this . myGrid . ctx . setColumns ( this . columnsOption1 )
47
+ this . myGrid . ctx . reGenerateColumns ( ) ;
48
+ }
49
+
50
+
51
+
52
+ setColumns2 ( ) {
53
+ this . myGrid . ctx . setColumns ( this . columnsOption2 )
54
+ this . myGrid . ctx . reGenerateColumns ( ) ;
55
+ }
56
+
57
+
58
+ singleClick ( e ) {
59
+ console . log ( "click" )
60
+ }
61
+
62
+
63
+ singleDblClick ( e ) {
64
+ console . log ( "dblClick" )
65
+ }
66
+
67
+ // sort1(){
68
+ // let sortArray = [
69
+ // {attribute:"name", asc:true},
70
+ // {attribute:"number", asc:false}
71
+ // ]
72
+ //
73
+ // this.myGrid.ctx.orderBy(sortArray);
74
+ //
75
+ // }
76
+
77
+
78
+ sort1 ( ) {
79
+ var columns = this . myGrid . ctx . getColumns ( ) ;
80
+ columns . pop ( ) ;
81
+ this . myGrid . ctx . setColumns ( columns )
82
+ this . myGrid . ctx . reGenerateColumns ( ) ;
83
+
84
+
85
+
86
+ }
87
+
88
+ sort2 ( ) {
89
+ let sortArray = [
90
+ { attribute :"name" , asc :false } ,
91
+ { attribute :"number" , asc :false }
92
+ ]
93
+
94
+ this . myGrid . ctx . orderBy ( sortArray ) ;
95
+
96
+ }
97
+
98
+ columnsOption1 = [
99
+ {
100
+ colWidth :122 ,
101
+ colField :"name"
102
+ } ,
103
+ {
104
+ colWidth :122 ,
105
+ colField :"bool"
106
+ } ,
107
+ {
108
+ colWidth :122 ,
109
+ colField :"number"
110
+ } ]
111
+
112
+
113
+ columnsOption2 = [
114
+ {
115
+ colWidth : 100 ,
116
+ colRowTemplate : null ,
117
+ colHeaderTemplate : null ,
118
+ colField : "name" ,
119
+ colHeaderName : "Full name" ,
120
+ colAddLabelAttributes : "" ,
121
+ colAddFilterAttributes : "" ,
122
+ colAddRowAttributes : "" ,
123
+ colSort : "name" ,
124
+ colFilter : true ,
125
+ colFilterTop : false ,
126
+ colCss : "" ,
127
+ colType : "text"
128
+ } ,
129
+ {
130
+ colWidth : 100 ,
131
+ colRowTemplate : null ,
132
+ colHeaderTemplate : null ,
133
+ colField : "bool" ,
134
+ colHeaderName : "Bool value" ,
135
+ colAddLabelAttributes : "" ,
136
+ colAddFilterAttributes : "" ,
137
+ colAddRowAttributes : "" ,
138
+ colSort : null ,
139
+ colFilter : true ,
140
+ colFilterTop : false ,
141
+ colCss : "" ,
142
+ colType : "checkbox"
143
+ } , {
144
+ colWidth : 100 ,
145
+ colRowTemplate : null ,
146
+ colHeaderTemplate : null ,
147
+ colField : "number" ,
148
+ colHeaderName : "Salery" ,
149
+ colAddLabelAttributes : "" ,
150
+ colAddFilterAttributes : "" ,
151
+ colAddRowAttributes : "" ,
152
+ colSort : null ,
153
+ colFilter : true ,
154
+ colFilterTop : false ,
155
+ colCss : "color:${tempRef.numberColor};font-weight:${tempRef.numberFont}" ,
156
+ colType : "text"
157
+ } ]
158
+
159
+
45
160
46
161
}
0 commit comments