This is a migrated thread and some comments may be shown as answers.

Kendo Grid changes are not reflected in Source object

1 Answer 12 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Bala
Top achievements
Rank 1
Bala asked on 02 Apr 2014, 01:20 PM
My bound objects have setters and while changing values in the grid cells, the setters are not getting called. Why?function PresonDetails(_contactName, _contactTitle, _country, _companyName) {

Object.defineProperties(this, {
"ContactName": {
get: function () {
return this._contactName;
},
set: function (value) {
alert("New ContactName is :" + value)
this._contactName = value; //Setter is not get called when i change the value in grid.
},
enumerable: true,
configurable: true
},
"ContactTitle": {
get: function () {
return this._contactTitle;
},
set: function (value) {
this._contactTitle = value;
},
enumerable: true,
configurable: true
},
"Country": {
get: function () {
return this._country;
},
set: function (value) {
this._country = value;
},
enumerable: true,
configurable: true
},
"CompanyName": {
get: function () {
return this._companyName;
},
set: function (value) {
this._companyName = value;
},
enumerable: true,
configurable: true
}
});

this.ContactName = _contactName;
this.ContactTitle = _contactTitle;
this.Country = _country;
this.CompanyName = _companyName;
}

(function () {
var details = [];
details.push(new PresonDetails("ContactName1", "ContactTitle", "USA", "MICro"));


var $grid = $('#grid');
$grid.kendoGrid({
scrollable: true,
dataSource: details,
groupable: false,
sortable: false,
editable: true,
columns: [{
field: "ContactName",
title: "Contact Name",
width: 200
}, {
field: "ContactTitle",
title: "Contact Title",
width: 250
}, {
field: "CompanyName",
title: "Company Name"
}, {
field: "Country",
width: 150,
}]
});
})();
Here is the http://jsfiddle.net/D4g8S/128/

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 04 Apr 2014, 06:10 AM
Hi,

I recommend checking this forum thread.

Regards,
Atanas Korchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
General Discussions
Asked by
Bala
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or