C#ASP.NET剑道在一行上执行多个编辑命令
我尝试在一行上使用多个剑道编辑命令。编辑按钮总数为6个,以及6个剑道开关。每个命令都有单独的C#ASP.NET剑道在一行上执行多个编辑命令,c#,asp.net,kendo-ui,C#,Asp.net,Kendo Ui,我尝试在一行上使用多个剑道编辑命令。编辑按钮总数为6个,以及6个剑道开关。每个命令都有单独的emailSubject、emailBody和emailAddress,它们与每个开关关联。我需要每个命令来打开剑道弹出窗口,并能够更新相关的电子邮件主题,电子邮件正文,和电子邮件地址 这就是我目前所拥有的:JS文件 DailyLimits.Methods.KendoInit = function () { DailyLimits.Controls.RenderedGrid = DailyLimits.C
emailSubject
、emailBody
和emailAddress
,它们与每个开关关联。我需要每个命令来打开剑道弹出窗口,并能够更新相关的电子邮件主题
,电子邮件正文
,和电子邮件地址
这就是我目前所拥有的:JS文件
DailyLimits.Methods.KendoInit = function () {
DailyLimits.Controls.RenderedGrid = DailyLimits.Controls.DailyLimitsGrid.kendoGrid({
dataSource: {
data: emailAlerts,
schema: {
model: {
id: "Id",
fields: {
Id: { type: "number", validation: { required: true } },
AccountNumber: { type: "string" },
CustomerName: { type: "string" },
Limit: { type: "number" },
CurrentUsage: { type: "number" },
EmailSubject: { type: "string" },
EmailBody: { type: "string" },
FromAddress: { type: "string" },
Alert1: { type: "boolean" },
Alert2: { type: "boolean" },
Alert3: { type: "boolean" },
Alert4: { type: "boolean" },
Alert5: { type: "boolean" },
Alert6: { type: "boolean" }
}
}
},
},
filterable:true,
height: "800px",
groupable: true,
sortable: true,
scrollable: true,
resizable: true,
columnResizeHandleWidth: 5,
columnMenu: true,
toolbar: kendo.template($("#ToolbarTemplate").html()),
columns: [
{ field: "AccountNumber", title: "Account Number", filterable: true, hidden: false, width: 100 },
{ field: "CustomerName", title: "Customer Name", filterable: true, hidden: false, width: 100 },
{ field: "Limit", title: "Daily Credit Limit", format: "{0:c}", filterable: true, hidden: false, width: 100 },
{ field: "CurrentUsage", title: "Current Usage", format: "{0:c}", filterable: true, hidden: false, width: 100 },
{ field: "Alert1", title: "75%", filterable: true, hidden: false, width: 100, "template": "<input type= \"checkbox\" class=\"mobileSwitch\" id=\"alert1-switch\" # if(Alert1) {# checked=\"checked\" #} # />" },
{
command: [{
name: "Edit1",
title: "Alert 1 Email",
width: "180px",
click: function (e) {
// prevent page scroll position change
e.preventDefault();
// e.target is the DOM element representing the button
var tr = $(e.target).closest("tr"); // get the current table row (tr)
// get the data bound to the current table row
var data = this.dataItem(tr);
console.log("Details for: " + data.AccountNumber);
}
}],
},
{ field: "Alert2", title: "80%", filterable: true, hidden: false, width: 100, "template": "<input type= \"checkbox\" class=\"mobileSwitch\" id=\"alert2-switch\" # if(Alert2) {# checked=\"checked\" #} # />" },
{
command: [{
name: "Edit2",
title: "Alert 2 Email",
width: "180px",
click: function (e) {
// prevent page scroll position change
e.preventDefault();
// e.target is the DOM element representing the button
var tr = $(e.target).closest("tr"); // get the current table row (tr)
// get the data bound to the current table row
var data = this.dataItem(tr);
console.log("Details for: " + data.AccountNumber);
}
}],
},
{ field: "Alert3", title: "85%", filterable: true, hidden: false, width: 100, "template": "<input type= \"checkbox\" class=\"mobileSwitch\" id=\"alert3-switch\" # if(Alert3) {# checked=\"checked\" #} # />" },
{
command: [{
name: "Edit3",
title: "Alert 3 Email",
width: "180px",
click: function (e) {
// prevent page scroll position change
e.preventDefault();
// e.target is the DOM element representing the button
var tr = $(e.target).closest("tr"); // get the current table row (tr)
// get the data bound to the current table row
var data = this.dataItem(tr);
console.log("Details for: " + data.AccountNumber);
}
}],
},
{ field: "Alert4", title: "90%", filterable: true, hidden: false, width: 100, "template": "<input type= \"checkbox\" class=\"mobileSwitch\" id=\"alert4-switch\" # if(Alert4) {# checked=\"checked\" #} # />" },
{
command: [{
name: "Edit4",
title: "Alert 4 Email",
width: "180px",
click: function (e) {
// prevent page scroll position change
e.preventDefault();
// e.target is the DOM element representing the button
var tr = $(e.target).closest("tr"); // get the current table row (tr)
// get the data bound to the current table row
var data = this.dataItem(tr);
console.log("Details for: " + data.AccountNumber);
}
}],
},
{ field: "Alert5", title: "95%", filterable: true, hidden: false, width: 100, "template": "<input type= \"checkbox\" class=\"mobileSwitch\" id=\"alert5-switch\" # if(Alert5) {# checked=\"checked\" #} # />" },
{
command: [{
name: "Edit5",
title: "Alert 5 Email",
width: "180px",
click: function (e) {
// prevent page scroll position change
e.preventDefault();
// e.target is the DOM element representing the button
var tr = $(e.target).closest("tr"); // get the current table row (tr)
// get the data bound to the current table row
var data = this.dataItem(tr);
console.log("Details for: " + data.AccountNumber);
}
}],
},
{ field: "Alert6", title: "100%", filterable: true, hidden: false, width: 100, "template": "<input type= \"checkbox\" class=\"mobileSwitch\" id=\"alert6-switch\" # if(Alert6) {# checked=\"checked\" #} # />" },
{
command: [{
name: "Edit6",
title: "Alert 6 Email",
width: "180px",
click: function (e) {
// prevent page scroll position change
e.preventDefault();
// e.target is the DOM element representing the button
var tr = $(e.target).closest("tr"); // get the current table row (tr)
// get the data bound to the current table row
var data = this.dataItem(tr);
console.log("Details for: " + data.AccountNumber);
}
}],
},
],
editable: "popup",
});
dailyllimits.Methods.KendoInit=函数(){
DailyLimits.Controls.RendereGrid=DailyLimits.Controls.DailyLimitsGrid.kendoGrid({
数据源:{
数据:电子邮件警报,
模式:{
型号:{
id:“id”,
字段:{
Id:{type:“number”,验证:{required:true},
帐号:{type:“string”},
客户名称:{type:“string”},
限制:{type:“number”},
当前用法:{type:“number”},
EmailSubject:{type:“string”},
EmailBody:{type:“string”},
FromAddress:{type:“string”},
警报1:{type:“boolean”},
警报2:{type:“boolean”},
警报3:{type:“boolean”},
警报4:{type:“boolean”},
警报5:{type:“boolean”},
警报6:{type:“boolean”}
}
}
},
},
可过滤:正确,
高度:“800px”,
分组:对,
可排序:是的,
可滚动:对,
可调整大小:正确,
columnResizeHandleWidth:5,
专栏菜单:是的,
工具栏:kendo.template($(“#ToolbarTemplate”).html(),
栏目:[
{字段:“AccountNumber”,标题:“AccountNumber”,可过滤:true,隐藏:false,宽度:100},
{字段:“CustomerName”,标题:“Customer Name”,可过滤:true,隐藏:false,宽度:100},
{字段:“限额”,标题:“每日信用限额”,格式:{0:c},可过滤:真,隐藏:假,宽度:100},
{字段:“CurrentUsage”,标题:“CurrentUsage”,格式:“{0:c}”,可筛选:true,隐藏:false,宽度:100},
{字段:“Alert1”,标题:“75%”,可过滤:真,隐藏:假,宽度:100,“模板”:“”,
{
命令:[{
名称:“编辑1”,
标题:“警报1电子邮件”,
宽度:“180px”,
点击:功能(e){
//防止页面滚动位置更改
e、 预防默认值();
//e.target是表示按钮的DOM元素
var tr=$(e.target).closest(“tr”);//获取当前表行(tr)
//获取绑定到当前表行的数据
var数据=此.dataItem(tr);
console.log(“详细信息:“+data.AccountNumber”);
}
}],
},
{字段:“Alert2”,标题:“80%”,可过滤:真,隐藏:假,宽度:100,“模板”:“”,
{
命令:[{
名称:“编辑2”,
标题:“警报2电子邮件”,
宽度:“180px”,
点击:功能(e){
//防止页面滚动位置更改
e、 预防默认值();
//e.target是表示按钮的DOM元素
var tr=$(e.target).closest(“tr”);//获取当前表行(tr)
//获取绑定到当前表行的数据
var数据=此.dataItem(tr);
console.log(“详细信息:“+data.AccountNumber”);
}
}],
},
{字段:“Alert3”,标题:“85%”,可过滤:真,隐藏:假,宽度:100,“模板”:“”,
{
命令:[{
名称:“编辑3”,
标题:“警报3电子邮件”,
宽度:“180px”,
点击:功能(e){
//防止页面滚动位置更改
e、 预防默认值();
//e.target是表示按钮的DOM元素
var tr=$(e.target).closest(“tr”);//获取当前表行(tr)
//获取绑定到当前表行的数据
var数据=此.dataItem(tr);
console.log(“详细信息:“+data.AccountNumber”);
}
}],
},
{字段:“Alert4”,标题:“90%”,可过滤:真,隐藏:假,宽度:100,“模板”:“”,
{
命令:[{
名称:“编辑4”,
标题:“警报4电子邮件”,
宽度:“180px”,
点击:功能(e){
//防止页面滚动位置更改
e、 预防默认值();
//e.target是表示按钮的DOM元素
var tr=$(e.target).closest(“tr”);//获取当前表行(tr)
//获取绑定到当前表行的数据
var数据=此.dataItem(tr);
console.log(“详细信息:“+data.AccountNumber”);
}
<script id="alert1_popup" type="text/x-kendo-template">
<div class="SearchParam">
<label class="control-label" for="txtEmailSubject" style="width:200px">Email Subject</label>
<input name="txtEmailSubject" id="txtEmailSubject" class="k-textbox" style="width:430px"
data-bind="value:Alert1EmailSubject"
/>
</div>
<div class="SearchParam">
<label class="control-label" for="txtEmailBody" style="width:200px">Email Body</label>
<textarea name="txtEmailBody" id="txtEmailBody" style="width:350px"
data-bind="value:Alert1EmailBody"
data-role="kendo.ui.Editor"
></textarea>
</div>
<div class="SearchParam">
<label class="control-label" for="txtFromAddress" style="width:200px">From Address</label>
<input name="txtFromAddress" id="txtFromAddress" class="k-textbox" style="width:430px"
data-bind="value:Alert1FromAddress"
/>
</div>
</script>