javascript - 剑道按钮数据单击剑道网格模板内不起作用

标签 javascript html kendo-ui kendo-grid kendo-mobile

我有一个像这样的剑道网格。在此模板中,我对按钮使用数据单击属性,但事件根本没有触发。我不知道出了什么问题。

这是我的代码。谁能帮忙。

    $("#defect_grid_general").kendoGrid({
        dataSource: ELQApp.GeneralDefectStore,
        columns: [
                { field: "Name", title: "Component" },
                { field: "Opname", title: "Operation" },
                { field: "DefectDescription", title: "Defect" },               
                { field: "qty", title: "Qty", template: "<input type='text' readonly='readonly' id=#=ELQGeneralDefectInfoId# onclick='ELQApp.ELQViewModel.LaunchKeyPad(this.id,&quot;gen_defect&quot;)'  style='width:60px' value='#=DefectQty#' readonly=readonly/> <a id='decrement_qty' name='-' data-role='button' onmousedown = 'ELQApp.ELQViewModel.IncrementDecrementValuesBtn1(this.name,&quot;#:ELQGeneralDefectInfoId#&quot;,&quot;update&quot;)' class='km-button minusBtn'></a><a  data-role='button' data-name='+'  data-type=#=ELQGeneralDefectInfoId#  data-flag='update' id='increment_qty' data-click='ELQApp.ELQViewModel.IncrementDecrementValuesBtn' class='km-button plusBtn'></a>", width: "155px" },
                { field: "", title: "", template: "<button  data-click='ELQApp.ELQViewModel.RemoveGeneralDefect'>Delete</button>" },
                { field: "", title: "", template: "<input type='button' value='More Info' name=#=ELQGeneralDefectInfoId# onclick='ELQApp.ELQViewModel.OpenModal(&quot;more_info_popup&quot;,this.name,this)' id='rem'/>", width: "110px" },
                { field: "", title: "", template: "<a id =#=ELQGeneralDefectInfoId# onclick='ELQApp.ELQViewModel.RemoveGeneralDefect(this.id)' class='deleteBtn'></a>", width: "50px" }
        ],
        height: 220,
    });

最佳答案

嘿,钦塔卡,

     <div id="test-grid" data-role="grid"  data-bind="source: testDataSource" 
     data-columns='[
            { 
                field: "Site",
                title: "Site"
            } , 
            { 
                title: "Action",
                template: kendo.template($("#conditional-action-template").html())

            }

        ]'></div>

<div id="log"></div>

  <script id="conditional-action-template" type="text/x-kendo-template">
# if(FirstActionEnabled) { #
<div class='action circle' data-bind="click: firstActionClick"></div>
# } #
# if(SecondActionEnabled) { #
<div class='action square' data-bind="click: secondActionClick"></div>
# } #
</script>

我给你 fiddle 链接..

链接- http://jsfiddle.net/falafelsoftware/B8ynX/

希望你喜欢..

如果你喜欢的话,别忘了投票给我...

关于javascript - 剑道按钮数据单击剑道网格模板内不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25347238/

相关文章:

javascript - 为什么 $(this) 在点击时正确调用但在悬停时不正确?

javascript - 可拖动/可滚动区域内的 iFrame

css - 无法解码下载的字体

javascript - 保留行号的自定义 console.log

javascript - 列表项事件悬停效果

javascript - js中的变量

javascript - 使用 Kendo UI 折线图,如何保持条形点连接? (见图)

javascript - 自定义复选框在剑道网格中不可单击

javascript - 如何在 Angular2 中使用正则表达式制作管道?

javascript - 使用 Mustache 将 JSON 文件集成到 html 中