【问题标题】:Kendo ui custom popup binding issueKendo ui自定义弹出绑定问题
【发布时间】:2015-04-06 11:06:33
【问题描述】:

我的剑道 ui 网格上有这个:

editable: {
            mode:"popup",

            template:kendo.template($("#popupGridClientes").html())

          },

这应该足以(我认为!)绑定到这样制作的自定义弹出模板:

<script type="text/x-kendo-template" id="popupGridClientes">

  <div class="k-edit-label"><label for="titulo">Titulo</label></div>
  <div data-container-for="titulo" class="k-edit-field"><input type="text" class="k-input k-textbox" name="titulo" data-bind="value:titulo"></div>

<div class="k-edit-label"><label for="bi">Bi</label></div>
  <div data-container-for="bi" class="k-edit-field"><input id="bi" type="number" name="bi" data-bind="value:bi" 
  data-value-field="bi" data-text-field="bi" data-source="bi"></div>

I have more fields but this was only to show how i did it...

</script>

现在,例如,我想在我的“bi”字段中设置一个 kendoNumericTextBox,所以我在我的 .js 文件中这样做(有文档说):

$("#bi").kendoNumericTextBox({
    format  : "0",
    decimals: 1,
    spinners : false
});

它不起作用,它也不适用于其他类型的字段,不仅适用于 kendonumeric!。它没有将我的自定义弹出模板绑定到我在 .js 文件中调用的函数,我还尝试为字段创建一个 editor ,但它也不起作用。我做错了什么?

谢谢,问候

【问题讨论】:

    标签: kendo-ui kendo-grid kendo-mobile kendo-dataviz


    【解决方案1】:

    小部件应该使用 data-role 属性进行初始化。我相信以下论坛主题会有所帮助:

    http://www.telerik.com/forums/custom-popup-editor-with-additional-fields

    【讨论】:

    • 谢谢!它工作正常,在我的 index.html 中我只有 data-bind="value:bi",而在我的 .js 文件中,我必须这样做:$(e.container).find("input[name= 'bi']").kendoNumericTextBox({ format : "0", decimals:0, step : 0, spinners : false });
    • 但是如果我想对其他需要数字框的字段执行此操作,我该如何执行?
    猜你喜欢
    • 2013-12-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多