-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathback.html
executable file
·225 lines (218 loc) · 16.9 KB
/
back.html
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
<li class="item">
<h2 class="collapse">Initial with type option</h2>
<ul class="collapse detail">
<li><em>Attribute Key:</em> type</li>
<li><em>Type:</em> String</li>
<li><em>Default:</em> get</li>
<li><em>Description:</em> You can set a get or post method type to reqest server side.</li>
<li> </li>
<li>
<em>Code examples:</em>
Initialize a tmGrid with the type option specified.<br /><br />
$('#tmGrid').tmGrid(<br />
{<br />
'dataProvider': 'handler/handler.php',<br />
'columns': columnsSetting<br />
'Type': 'get'<br />
}<br />
);<br /><br />
Get or set the type option, after init.<br />
//getter<br />
var type= $('#tmGrid').tmGrid('option', 'type');<br /><br />
//setter<br />
$('#tmGrid').tmGrid('option', 'type', newtype);<br /><br />
</li>
</ul>
<div>
<label>
$('#tmGrid').tmGrid({<br/>
'dataProvider': 'handler/handler.php',<br/>
'columns': columnsSetting,<br/>
'type': 'post'<br/>
});
</label>
<div class="content">
<table id="tmGrid_type"></table>
</div>
<script>
/*$('#tmGrid_type').tmGrid({
dataProvider: 'handler/handler.php',
columns: columns2,
limit: 10,
type: 'POST'
}); */
</script>
</div>
</li>
<li class="item">
<h2 class="collapse">Initial with valueIndex option</h2>
<ul class="collapse detail">
<li><em>Attribute Key:</em> valueIndex</li>
<li><em>Type:</em> String</li>
<li><em>Default:</em> Null</li>
<li><em>Description:</em> You can assign a index key for you to select which relatives to data</li>
<li> </li>
<li>
<em>Code examples:</em>
Initialize a tmGrid with the valueIndex option specified.<br /><br />
var data= [<br />
{<br />
'sn': 18452,<br />
'column1_key': 'Row 1 - Column 1 - Value',<br />
'column2_key': 'Row 1 - Column 2 - Value',<br />
'column3_key': true,<br />
'level_key': 2,<br />
'otherData': 'Other Data'<br />
},<br />
{<br />
'sn': 56464,<br />
'column1_key': 'Row 2 - Column 1 - Value',<br />
'column2_key': 'Row 2 - Column 2 - Value',<br />
'column3_key': false,<br />
'level_key': 4,<br />
'otherData': 'Other Data'<br />
},<br />
{<br />
'sn': 4842156,<br />
'column1_key': 'Row 3 - Column 1 - Value',<br />
'column2_key': 'Row 3 - Column 2 - Value',<br />
'column3_key': true,<br />
'level_key': 1,<br />
'otherData': 'Other Data'<br />
},<br />
{<br />
'sn': 455433,<br />
'column1_key': 'row 4 - Column 1 - Value',<br />
'column2_key': 'Row 4 - Column 2 - Value',<br />
'column3_key': false,<br />
'level_key': 3,<br />
'otherData': 'Other Data'<br />
},<br />
{<br />
'sn': 5454564,<br />
'column1_key': 'Row 5 - Column 1 - Value',<br />
'column2_key': 'Row 5 - Column 2 - Value',<br />
'column3_key': false,<br />
'level_key': 4,<br />
'otherData': 'Other Data'<br />
}<br />
];<br />
$('#tmGrid').tmGrid(<br />
{<br />
'dataProvider': data,<br />
'columns': columnsSetting<br />
'valueIndex': 'sn'<br />
}<br />
);<br /><br />
Get or set the valueIndex option, after init.<br />
//getter<br />
var type= $('#tmGrid').tmGrid('option', 'valueIndex');<br /><br />
//setter<br />
$('#tmGrid').tmGrid('option', 'valueIndex', newValueIndex);<br /><br />
</li>
</ul>
<div>
<label>
var data= [<br />
{<br />
'sn': 18452,<br />
'column1_key': 'Row 1 - Column 1 - Value',<br />
'column2_key': 'Row 1 - Column 2 - Value',<br />
'column3_key': true,<br />
'level_key': 2,<br />
'otherData': 'Other Data'<br />
},<br />
{<br />
'sn': 56464,<br />
'column1_key': 'Row 2 - Column 1 - Value',<br />
'column2_key': 'Row 2 - Column 2 - Value',<br />
'column3_key': false,<br />
'level_key': 4,<br />
'otherData': 'Other Data'<br />
},<br />
{<br />
'sn': 4842156,<br />
'column1_key': 'Row 3 - Column 1 - Value',<br />
'column2_key': 'Row 3 - Column 2 - Value',<br />
'column3_key': true,<br />
'level_key': 1,<br />
'otherData': 'Other Data'<br />
},<br />
{<br />
'sn': 455433,<br />
'column1_key': 'row 4 - Column 1 - Value',<br />
'column2_key': 'Row 4 - Column 2 - Value',<br />
'column3_key': false,<br />
'level_key': 3,<br />
'otherData': 'Other Data'<br />
},<br />
{<br />
'sn': 5454564,<br />
'column1_key': 'Row 5 - Column 1 - Value',<br />
'column2_key': 'Row 5 - Column 2 - Value',<br />
'column3_key': false,<br />
'level_key': 4,<br />
'otherData': 'Other Data'<br />
}<br />
];<br /><br />
$('#tmGrid').tmGrid({<br/>
'dataProvider': data,<br/>
'columns': columnsSetting,<br/>
'valueIndex': 'sn'<br/>
});
</label>
<div class="content">
<table id="tmGrid_valueIndex"></table>
</div>
<script>
var data3= [
{
'sn': 18452,
'column1_key': 'Row 1 - Column 1 - Value',
'column2_key': 'Row 1 - Column 2 - Value',
'column3_key': true,
'level_key': 2,
'otherData': 'Other Data'
},
{
'sn': 56464,
'column1_key': 'Row 2 - Column 1 - Value',
'column2_key': 'Row 2 - Column 2 - Value',
'column3_key': false,
'level_key': 4,
'otherData': 'Other Data'
},
{
'sn': 4842156,
'column1_key': 'Row 3 - Column 1 - Value',
'column2_key': 'Row 3 - Column 2 - Value',
'column3_key': true,
'level_key': 1,
'otherData': 'Other Data'
},
{
'sn': 455433,
'column1_key': 'row 4 - Column 1 - Value',
'column2_key': 'Row 4 - Column 2 - Value',
'column3_key': false,
'level_key': 3,
'otherData': 'Other Data'
},
{
'sn': 5454564,
'column1_key': 'Row 5 - Column 1 - Value',
'column2_key': 'Row 5 - Column 2 - Value',
'column3_key': false,
'level_key': 4,
'otherData': 'Other Data'
}
];
/*$('#tmGrid_valueIndex').tmGrid({
dataProvider: data3,
columns: columns,
limit: 10,
valueIndex: 'sn'
}); */
</script>
</div>
</li>