现在,我正在使用一个窗口来查看网格中没有显示的细节。我也在窗口中做了自己的自定义编辑器,它隐藏了细节,并用输入替换了它们。
不幸的是,我无法让Update按钮具有与kendo工具栏中的更新按钮相同的功能。
我使用传输和参数映射为我的创建,这是完美的工作。我只需要能够点击更新,这是我无法做到的。
下面是模板的代码片段:
<li><b>Change Control Objective</b></li>
<li><textarea type="text" class="k-textbox k-input" data-bind="value:ChangeControlObjective">#= ChangeControlObjective #</textarea></li>
<li><b>Change Control Specifics</b></li>
<li><textarea type="text" class="k-textbox k-input" data-bind="value:ChangeControlSpecifics">#= ChangeControlSpecifics #</textarea></li>
<a href="\\#" class="k-button k-button-icontext k-grid-update"><span class="k-update k-icon k-i-tick"></span>Save</a>我无法显示我的JS代码,但它是基于dojo:http://dojo.telerik.com/abUHI的
更新:
我可以点击保存按钮点击参数地图中的更新,但是它将旧数据发送到更新中,而不是新的。下面是单击代码的按钮:
$("#saveChanges").click(function () {
dataItem.dirty = true;
$("#ccrGrid").data('kendoGrid').saveChanges();
});每个输入都有一个数据绑定属性,参数映射如下所示:
case "update":
var changeControlRequestId = options.ChangeControlRequestID;
var changeControlObjective = options.ChangeControlObjective;
var changeControlSpecifics = options.ChangeControlSpecifics;
var productAssociation;
if (options.AccountChangeInfo.ProductAssocation == undefined) {
productAssociation = "";
} else { productAssociation = options.ProductAssocation; }
var amortization;
if (options.AccountChangeInfo.Amortization == undefined) {
amortization = "";
} else { amortization = options.Amortization; }
var productType;
if (options.ProductChangeInfo.ProductType == undefined) {
productType = "";
} else { productType = options.ProductType; }
var productName;
if (options.ProductChangeInfo.ProductName == undefined) {
productName = "";
} else { productName = options.ProductName; }
var productDescription;
if (options.ProductChangeInfo.ProductDescription == undefined) {
productDescription = "";
} else { productDescription = options.ProductDescription; }
var productContract;
if (options.ProductChangeInfo.ProductContractualFeatures == undefined) {
productContract = "";
} else { productContract = options.ProductContractualFeatures; }
var productBehavior;
if (options.ProductChangeInfo.ProductBehavioralAssumptions == undefined) {
productBehavior = "";
} else { productBehavior = options.ProductBehavioralAssumptions; }
var evaluationBehavior;
if (options.ProductChangeInfo.ProductEvaluationBehavior == undefined) {
evaluationBehavior = "";
} else { evaluationBehavior = options.ProductEvaluationBehavior; }
var productStratification;
if (options.ProductChangeInfo.ProductStratificationRoutines == undefined) {
productStratification = "";
} else { productStratification = options.ProductStratificationRoutines; }
if (content.isreadonly == "True") {
alert("you have readonly access");
}
else {
var urlString = "env=" + content.env + "&allyid=" + content.userId + "&changeRequestID" + changeRequestID + "&changeControlObjective=" + changeControlObjective + "&changeControlSpecifics=" + changeControlSpecifics +
"&productAssociation" + productAssociation + "&amortization" + amortization +
"&productType" + productType + "&productName" + productName + "&productDescription" + productDescription +
"&productContract" + productContract + "&productBehavior" + productBehavior + "&evaluationBehavior" + evaluationBehavior +
"&productStratification" + productStratification;
return urlString;发布于 2016-12-07 23:33:07
我几个月前就经历过这个了。根据我的广泛研究,在整个互联网上,在Kendo中进行自定义弹出编辑有两个关键来源;):
自定义编辑器模板 i为您在这里创建了一个简化的版本:http://jsbin.com/qudotag/来削减元素,一旦您掌握了关键的概念就可以展开这些元素。请注意,由于更改没有持久化,这并不能完全工作。这是预期的行为,因为您需要定义网格的CRUD操作(当保存、取消等操作完成时会发生什么)。
如何处理CRUD可以在第二个源:外型Crud中找到
对这2的一些深入研究,以及更深入的MVVM (这可能一开始很吓人,但是对于Kendo的更顺畅的工作确实很有用)会让你开始学习。
编辑:实际上,您可以只使用第一种方法,这是更容易和保留状态,刷新后的网格取消。
https://stackoverflow.com/questions/41027107
复制相似问题