Jquery 剑道ui js编辑弹出窗口出现在工具栏中
这是我的模板:Jquery 剑道ui js编辑弹出窗口出现在工具栏中,jquery,kendo-ui,kendo-grid,Jquery,Kendo Ui,Kendo Grid,这是我的模板: $("#manage-products-grid").kendoGrid({ columns:[ { field: "Id", title: "Product Id", width: 150 }, { field: "Name", title: "Name",
$("#manage-products-grid").kendoGrid({
columns:[
{
field: "Id",
title: "Product Id",
width: 150
},
{
field: "Name",
title: "Name",
width: 250
},
{
field: "ShortDescription",
title: "Short Description"
},
{
field: "ProductType",
hidden: true
},
{
field: "MinimumOrderQuantity",
hidden: true
},
{
field: "PackSize",
hidden: true
},
{
field: "LeadTime",
hidden: true
},
{
field: "Weight",
hidden: true
},
{
command: [{ text: "Edit", template: "<a class='k-button k-button-icontext k-grid-edit'>Edit</a>" }, { text: "Manage Details", click: managedetails }, { text: "Delete", template: "<a class='k-button k-button-icontext k-grid-delete'>Delete</a>" }],
width: 300
}],
editable: {
mode: "popup",
template: kendo.template($("#popup-editor").html())
},
pageable: {
refresh: true,
buttonCount: 5,
pageSizes: [5, 10, 15, 20, 25, 50]
},
toolbar: kendo.template($("#manage-product-popup-template").html()),
dataBound: function () {
//This is a little hack to remove the lodingmodel in the filterfield. Somehow it doesn't dissappear when item gets selected
removeLoadingModal();
},
dataSource: manageProductDataSource()
});
function manageProductDataSource() {
var datasource = new kendo.data.DataSource({
transport: {
read: {
url: appPath + "/Product/GetByCompany",
dataType: "json",
type: "POST"
},
destroy: {
url: appPath + "/Product/Delete",
dataType: "json",
type: "POST"
},
parameterMap: function (data, type) {
if (type == "read") {
return {
companyName: $("#company-drp").val(),
pageSize: data.pageSize,
skip: data.skip,
searchText: $("#productSearch").val()
}
}
if (type == "destroy") {
return {
companyName: $("#company-drp").val(),
productId: data.Id
}
}
}
},
pageSize: 15,
serverPaging: true,
serverFiltering: true,
schema: {
data: "ProductDtos",
total: "ProductCount",
model: {
id: "Id",
fields: {
Id: { editable: false},
Name: { },
ShortDescription: {},
ProductType: { type: "number" },
MinimumOrderQuantity: { type: "number" },
PackSize: { type: "number" },
LeadTime: {},
Weight: { type: "decimal" },
}
}
}
});
return datasource;
}
这就是它看起来的样子
那么为什么它会出现在工具栏而不是弹出窗口中呢?
我似乎覆盖了常用的工具栏模板。不知何故,它只是覆盖它,使工具栏模板消失。是否尝试将模板的内容包装到父元素中,如a?是否有关闭模板的方法?
<script id="popup-editor" type="text/x-kendo-template">
<h3>Edit Person</h3>
<p>
<label>Product Id: <input name="ProductId" /></label>
</p>
<p>
<label>Short Description: <input name="ShortDescription" /></label>
</p>