HI,
I am following http://demos.kendoui.com/web/grid/editing-popup.html example of yours and in my case i have one checkbox(Notify) and two number type columns(Notification Amount & Performed Every). what i want to do is disabling the two number type columns(Notification Amount & Performed Every) when checkbox type column(Notify) is is unchecked and enabling these when checkbox is checked..
The code is as follows:
var dataSourceForAssetType = new kendo.data.DataSource({
transport: {
read: {
url: '@Url.Action("AssetType", "Home")',
dataType: "jsonp"
},
destroy: {
url: '@Url.Action("DeleteAssetType", "Home")',
dataType: "jsonp"
},
create: {
url: '@Url.Action("CreateAssetType", "Home")',
dataType: "jsonp"
},
update: {
url: '@Url.Action("UpdateAssetType", "Home")',
dataType: "jsonp"
},
parameterMap: function (options, operation) {
if (operation !== "read" && options.models) {
return { models: kendo.stringify(options.models) };
}
}
},
pageSize: 5,
schema: {
model: {
id: "AssetTypeID",
fields: {
AssetTypeID: { editable: false },
Description: { validation: { required: true} },
Notify: { type: "boolean" },
NotificationAmount: { type: "number" },
PerformedEvery: { type: "number" }
}
}
}
});
$("#grdAssetType").kendoGrid({
dataSource: dataSourceForAssetType,
pageable: true,
resizable: true,
groupable: true,
toolbar: ["create"],
columns: [
{ field: "Description", title: "Description" },
{ field: "Notify", title: "Notify ?" },
{ field: "NotificationAmount", title: "Notification Amount(Days)" },
{ field: "PerformedEvery", title: "Performed Every(Days before due)" },
{ command: ["edit"], title: " ", width: "100px" },
{ command: ["destroy"], title: " ", width: "100px"}],
editable: "popup"
});
How can i achieve these.
I Have also applied my custom editor for the checkbox column with custom attribute so to recognize the textbox and change the behaviour with the jquery.attr property like below:
editor: function (container, options) {
$('<input type="checkbox" myattr="notifyattr" name="' + options.field + '"/>')
.appendTo(container);
}
but now i am losing binding for this field.
Can you please help me out with the solution for this?
I am following http://demos.kendoui.com/web/grid/editing-popup.html example of yours and in my case i have one checkbox(Notify) and two number type columns(Notification Amount & Performed Every). what i want to do is disabling the two number type columns(Notification Amount & Performed Every) when checkbox type column(Notify) is is unchecked and enabling these when checkbox is checked..
The code is as follows:
var dataSourceForAssetType = new kendo.data.DataSource({
transport: {
read: {
url: '@Url.Action("AssetType", "Home")',
dataType: "jsonp"
},
destroy: {
url: '@Url.Action("DeleteAssetType", "Home")',
dataType: "jsonp"
},
create: {
url: '@Url.Action("CreateAssetType", "Home")',
dataType: "jsonp"
},
update: {
url: '@Url.Action("UpdateAssetType", "Home")',
dataType: "jsonp"
},
parameterMap: function (options, operation) {
if (operation !== "read" && options.models) {
return { models: kendo.stringify(options.models) };
}
}
},
pageSize: 5,
schema: {
model: {
id: "AssetTypeID",
fields: {
AssetTypeID: { editable: false },
Description: { validation: { required: true} },
Notify: { type: "boolean" },
NotificationAmount: { type: "number" },
PerformedEvery: { type: "number" }
}
}
}
});
$("#grdAssetType").kendoGrid({
dataSource: dataSourceForAssetType,
pageable: true,
resizable: true,
groupable: true,
toolbar: ["create"],
columns: [
{ field: "Description", title: "Description" },
{ field: "Notify", title: "Notify ?" },
{ field: "NotificationAmount", title: "Notification Amount(Days)" },
{ field: "PerformedEvery", title: "Performed Every(Days before due)" },
{ command: ["edit"], title: " ", width: "100px" },
{ command: ["destroy"], title: " ", width: "100px"}],
editable: "popup"
});
How can i achieve these.
I Have also applied my custom editor for the checkbox column with custom attribute so to recognize the textbox and change the behaviour with the jquery.attr property like below:
editor: function (container, options) {
$('<input type="checkbox" myattr="notifyattr" name="' + options.field + '"/>')
.appendTo(container);
}
but now i am losing binding for this field.
Can you please help me out with the solution for this?