-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmethod.html
executable file
·155 lines (153 loc) · 9.81 KB
/
method.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
<li class="item">
<h2 class="collapse">Use actionItemDisable method after initialization.</h2>
<ul class="collapse detail">
<li><em>Description:</em> You can disable or enable any action button after initialized tmGrid instance.</li>
<li><em>Arguments:</em> item- while action item you want to disable.</li>
<li>
<em>Code examples:</em><br /><br />
var item= $('#tmGrid').tmGrid('option', 'actionItems')[0].element;<br/>
$('#tmGrid').tmGrid('actionItemDisable', item);
</li>
</ul>
<div>
<label>
var actionIcons= [<br/>
{<br/>
'name': 'Edit',<br/>
'clssName': 'button_edit',<br/>
'tmPopup': {<br/>
'title': 'Edit Something Popup',<br/>
'url': 'popup/popup_content.html',<br/>
'buttons': [<br/>
{<br/>
name: 'Save',<br/>
click: function(){<br/>
Do something...<br/>
}<br/>
},<br/>
{<br/>
name: 'Cancel',<br/>
click: function(){<br/>
var parentButton= $('#tmGrid_actionItem').tmGrid('option', 'actionItems');<br/>
var button= parentButton[0].element
$(button).tmPopup('close');<br/>
}<br/>
}<br/>
]<br/>
},<br/>
'disabled': true<br/>
},<br/>
{<br/>
'name': 'Delete',<br/>
'clssName': 'button_remove',<br/>
'click': function(){<br/>
alert('delete');<br/>
},<br/>
'disabled': true<br/>
}<br/><br/><br/>
];<br/>
var tmGrid= $('#tmGrid_actionItemEnableDisable');<br/>
tmGrid.tmGrid({<br/>
dataProvider: data,<br/>
columns: columns,<br/>
actionItems: actionIcons,<br/>
limit: 10,<br/>
select: function(event, ui, data){<br/>
var editItem= tmGrid.tmGrid('option', 'actionItems')[0].element;<br/>
console.log(editItem);<br/>
if(ui.length == 1){<br/>
tmGrid.tmGrid('actionItemEnable', editItem);<br/>
}else{<br/>
tmGrid.tmGrid('actionItemDisable', editItem);<br/>
}<br/>
}<br/>
});
</label>
<div class="content">
<table id="tmGrid_actionItemEnableDisable"></table>
</div>
<script>
var actionIcons2= [
{
'name': 'Edit',
'clssName': 'button_edit',
'tmPopup': {
'title': 'Edit Something Popup',
'url': 'popup/popup_content.html',
'buttons': [
{
name: 'Save',
click: function(){
}
},
{
name: 'Cancel',
click: function(){
var parentButton= $('#tmGrid_actionItem').tmGrid('option', 'actionItems');
var button= parentButton[0].element
$(button).tmPopup('close');
}
}
]
},
'disabled': true
},
{
'name': 'Delete',
'clssName': 'button_remove',
'click': function(){
alert('delete');
},
'disabled': true
}
];
var tmGrid= $('#tmGrid_actionItemEnableDisable');
/*tmGrid.tmGrid({
dataProvider: data,
columns: columns,
actionItems: actionIcons2,
limit: 10,
select: function(event, ui, data){
var editItem= tmGrid.tmGrid('option', 'actionItems')[0].element;
console.log(editItem);
if(ui.length == 1){
tmGrid.tmGrid('actionItemEnable', editItem);
}else{
tmGrid.tmGrid('actionItemDisable', editItem);
}
}
});
*/</script>
</div>
</li>
<li class="item">
<h2 class="collapse">Use option(getter) method after initialization</h2>
<ul class="collapse detail">
<li><em>Description:</em> Get any tmButton option.</li>
<li>
<em>Code examples:</em><br /><br />
var value= $('#tmButton').tmButton('option', 'optionName');
</li>
</ul>
<label>
$('#tmButton_method_option_getter').tmButton({<br/>
name: "Org Name",<br/>
click: function(e){<br/>
var name= $('#tmButton_method_option_getter').tmButton("option", "name");<br/>
alert(name);<br/>
}<br/>
});
</label>
<div class="content">
<a id="tmButton_method_option_getter"></a>
</div>
<script>
/*$('#tmButton_method_option_getter').tmButton({
name: "Org Name",
click: function(e){
var name= $('#tmButton_method_option_getter').tmButton("option", "name");
alert(name);
}
});
*/</script>
</li>