In a kendo grid, in grid cell when I change a value kendo's dirty flag is displayed. But then when I click back to the same grid cell and change it to the previous value (already existing value) the dirty flag still appears.
How can I check whether the value is similar to the previous value and not display the dirty flag before saving.
Below is my code for kendo editable dropdown.
function editCategoryDropDown(container, options) {
var catObject = JSON.parse(ticketProjectCategoryObject.value);
$('<div id="categoryDDTreeView" class="dropDownTreeViewStyle"/>').appendTo(container);
var catDropDownTreeView = $("#categoryDDTreeView").kendoExtDropDownTreeView({
treeview: {
dataSource: new kendo.data.HierarchicalDataSource({
data: catObject
}),
//expended: true,
loadOnDemand: false,
change: function (e) {
{
var dropDownTreeViewObj = $('#categoryDDTreeView').find('.k-input');
var nodeTitle = dropDownTreeViewObj.attr("title");
if (nodeTitle != null) {
options.model.Category = nodeTitle;
options.model.CategoryId = dropDownTreeViewObj.attr("nodevalue")
options.model.dirty = true;
container.addClass("k-dirty-cell");
}
};
}
},
}).data("kendoExtDropDownTreeView");
var dropDownBox = catDropDownTreeView.dropDownList();
dropDownBox.text(options.model.Category)
var treeView = catDropDownTreeView.treeview();
var node = treeView.findByText(options.model.Category.split("|").pop().trim());
treeView.select(node);
}