Jquery 剑道ui网格弹出隐藏按钮

Jquery 剑道ui网格弹出隐藏按钮,jquery,kendo-ui,kendo-grid,Jquery,Kendo Ui,Kendo Grid,如何删除剑道模板弹出窗口上的更新/取消按钮?并添加我自己的自定义按钮 请尝试,这可能会对您有所帮助 但这是为普通用户隐藏按钮 var is_editable = false; var role = "<?php echo setting('admin.Admin_role_id') ?>"; @if(Auth::user()->role_id == setting('admin.Admin_role_id', 1)) is_editable = tr

如何删除剑道模板弹出窗口上的更新/取消按钮?并添加我自己的自定义按钮


请尝试,这可能会对您有所帮助
但这是为普通用户隐藏按钮

var is_editable = false;
    var role = "<?php echo setting('admin.Admin_role_id') ?>";

    @if(Auth::user()->role_id == setting('admin.Admin_role_id', 1))

    is_editable = true;

    @endif

    editing: {
                mode: "popup",
                allowAdding: is_editable,
                allowDeleting: is_editable,
                allowUpdating: is_editable,
                popup: {
                    title: "Employee Attendance  Information",
                    showTitle: true,
                    id: "employees->id",
                    position: {
                        my: "top",
                        at: "top",
                        of: window
                    }
                }
            },
var可编辑=false;
var-role=“”;
@if(Auth::user()->role\u id==设置('admin.admin\u role\u id',1))
是否可编辑=真;
@恩迪夫
编辑:{
模式:“弹出”,
Allowading:是否可编辑,
AllowDeleteing:是否可编辑,
AllowUpdate:是否可编辑,
弹出窗口:{
标题:“员工考勤信息”,
节目名称:真的,
id:“员工->id”,
职位:{
我的:“上衣”,
在“顶部”,
的:窗口
}
}
},
试试看

您可以订阅网格的编辑事件处理程序。一旦活动结束 您可以在e.container参数中找到该按钮,然后 隐藏它或相应地更改其文本

$(文档).ready(函数(){
var dataSource=new kendo.data.dataSource({
页面大小:5,
数据:产品,
自动同步:对,
模式:{
型号:{
id:“产品id”,
字段:{
ProductID:{可编辑:false,可空:true},
产品名称:{验证:{必需:true}},
类别:{defaultValue:{CategoryID:1,CategoryName:“饮料”}
}
}
}
});
$(“#网格”).kendoGrid({
可编辑:{
模式:“弹出”,
模板:$(“#模板”).html()
},
数据源:数据源,
pageable:对,
编辑:功能(e){
////隐藏按钮
//e.container.find(“.k-grid-update”).hide();
//e.container.find(“.k-grid-cancel”).hide();
////更改按钮的名称
e、 container.find(“.k-grid-update”).text(“自定义编辑文本”);
e、 container.find(“.k-grid-cancel”).text(“自定义取消文本”);
////添加新按钮
e、 container.find(“.k-edit-buttons”).append(“我的新按钮”)
$(“#类别”)。kendoDropDownList({
选项标签:“选择类别…”,
dataTextField:“CategoryName”,
dataValueField:“类别ID”,
更改:函数(){
e、 model.Category.CategoryName=this.text();
e、 model.ProductID=e.sender.dataSource.data().length;
},
数据源:{
类型:“odata”,
是的,
运输:{
阅读:“https://demos.telerik.com/kendo-ui/service/Northwind.svc/Categories"
}
}
});
$(“#产品”)。kendoDropDownList({
自动绑定:错误,
来自:“类别”,
选项标签:“选择产品…”,
dataTextField:“产品名称”,
dataValueField:“产品ID”,
更改:函数(){
e、 model.ProductName=this.text();
},
数据源:{
类型:“odata”,
是的,
运输:{
阅读:“https://demos.telerik.com/kendo-ui/service/Northwind.svc/Products"
}
}
});
},
工具栏:[“创建”],
栏目:[
{字段:“产品名称”,标题:“产品名称”},
{字段:“Category”,标题:“Category”,宽度:“160px”,模板:“#=Category.CategoryName#”},
{命令:[“编辑”、“销毁”],标题:,宽度:“200px”}]
});
})

剑道UI片段
#if(data.isNew()){#
#var createTemp=kendo.template($(“\\#createTemplate”).html()#
#=createTemp(数据)#
#}否则{#
#var createTemp=kendo.template($(“\\\编辑模板”).html()#
#=createTemp(数据)#
#}#