生成排按钮的单击事件,并添加图标?如何 [英] generate event on row button click and add icon? how to
本文介绍了生成排按钮的单击事件,并添加图标?如何的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这里是我的html code
here is my html code
<div id="grdCurrencies"
data-selectable="true"
data-role="grid"
data-pageable=" true"
data-sortable=" true"
data-columns='[
{ "field": "CurrencyCode", "width": 100 },
{ "field": "CurrencyName", "width": 100 } ,
{ field:"", template:"<i "class=" fa fa-trash-o grid-icon" data-bind="click: destroy"">del<"/"i>" , "width":40 }]'
data-bind="source: dsProduct, events: {change: OnGridActiveRowChanged} "
style=" height :500px;width:35%;">
</div>
在费尔德模板:德尔,我要补充的图标,也是我必须触发一个事件onclicking图标,在链接我不得不放弃CALSS和事件名字点击,但如何
in the feild template:'del, i have to add icon and also i have to fire an event onclicking icon for that in link i have to give calss and event name on click but how to ?
推荐答案
添加数据模板=MyTemplate的
属性在网格,下面是样品code的模板。这可能做的伎俩
Add data-template="mytemplate"
attribute in grid and following is the sample code of template. This might do the trick
<script id="mytemplate" type="text/x-kendo-template">
<tr>
<td data-bind="text:CurrencyCode"></td>
<td data-bind="text:CurrencyName"></td>
<td class="text-center" width="13%">
<i class="fa fa-trash-o" data-bind="click: removeRec"></i>
</td>
</tr>
</script>
这篇关于生成排按钮的单击事件,并添加图标?如何的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文