I have a Grid defined as:
With a custom editor for the company name defined as:
Where the debugger line is in the select event, I would like to set the value of the CompanySubType to item.SubType. I have verified that I can get the SubType, but I cannot for the life of me figure out how to set the value of the CompanySubType column. Could someone demonstrate how to set this value?
Jason
$(
"#FloorPlanGrid"
).kendoGrid({
dataSource: floorPlanSource,
toolbar: [
'create'
],
columns: [
{field:
'CompanyName'
, title:
'Company Name'
, editor: flooringDropDown},
{field:
'AccountNumber'
, title:
'Account Number'
},
{field:
'CompanySubType'
, title:
'Sub Type'
},
{field:
'Active'
, title:
'Active'
},
{field:
'CreditAvailable'
, title:
'Credit Available'
},
{field:
'DFINumber'
, title:
'DFI Number'
},
{field:
'ClosedDate'
, title:
'Closed Date'
},
{ command: [
'edit'
,
'destroy'
] }
],
editable:
'inline'
,
//edit: function (e) {
// debugger;
//}
});
function
flooringDropDown(container, options) {
$(
"<input required data-text-field='Text' data-value-field='Value' data-bind='value: "
+ options.field +
"'/>"
)
.appendTo(container)
.kendoDropDownList({
autoBind:
false
,
dataSource: {
transport: {
read: window.PaymentOutsideOptionsUrl
}
},
select:
function
(e) {
var
item =
this
.dataItem(e.item.index());
if
(item) {
console.log(item.SubType);
debugger;
}
}
}
);
}
Jason