duanfang7270 2013-04-18 11:29
浏览 190
已采纳

用于创建按钮的KendoUI网格自定义弹出模板

i have installed KendoGrid with POPUP option.

Now i am stuck someplace and i cant find any help to fix it with the way i want..

So here is problem that i am facing with KendoGrid popup editing.

When i click ADD New Record, the header on Top shows Edit, same as it shows on when i click on Edit.

http://jsfiddle.net/valchev/BCBzS/1/

also the button shows Update, instead it should be save button on create popup window..

i think i have to add something more like this below for creating new record..

editable: {
    mode: "popup",
    template: kendo.template($("#popup_editor").html())
},

and have the popup create template different from edit template?

Can anyone help me resolve this issue?

  • 写回答

3条回答 默认 最新

  • dongwen1909 2013-04-18 13:41
    关注

    If you look at the demo page for popup editing this seems to be the normal behaviour...

    But you can trick and use the edit event of the grid in order to change that. Just add at the beginning of this event the following code :

    if(!e.model.Id) {
        $(".k-window .k-window-title").text("Add new record");
        $(".k-window .k-grid-update").html("<span class=\"k-icon k-update\"></span>Create");
    }   
    

    See the updated jsFiddle.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?