Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
14
rated 0 times [  21] [ 7]  / answers: 1 / hits: 18475  / 13 Years ago, sun, march 4, 2012, 12:00:00

I'm working with a kendo grid and I'm trying to make Name field a combobox that has it's own datasource. I'm not getting a javascript error, but when I go to edit the name field in the grid, it is not showing a ComboBox. It still shows an input field.



$(function () {

console.log(ready);

var datasource = new kendo.data.DataSource({
transport: {
read: {
url: , // Returns all items
dataType: json
}
},
pageSize: 10,
schema: {
model: {
id: Id,
fields: {
Id: { type: number, editable: false, nullable: false, visible: false },
Name: { type: string, editable: true, nullable: false, validation: { required: true} },
Description: { type: string, editable: true, validation: { required: true} }
}
}
}
});

var grid = $(#grid).kendoGrid({
dataSource: datasource,
editable: true,
height: 400,
columns: [
{ field: Id, width: 200 },
{
field: Name,
editor: function (container, options) { // This is where you can set other control types for the field.
$('< input name=' + options.field + '/>').appendTo(container).kendoComboBox({
dataSouce: [{ Id: 1, Name: MaryMaryMary }, { Id: 2, Name: John}],
dataValueField: Id,
dataTextField: Name,
});
}
}
],
dataBound: function (e) {
console.log(DataBound);
}
});

});


I'm not getting any javascript errors.


More From » jquery

 Answers
2

For those who desperately need a custom editor now and can't wait for next release, just like me... :-)



...here is my workaround... change line #12320 of kendo.all.js to this:



fields: { field: column.field, format: column.format, editor: column.editor },


...and voilà! Now the editor setting for the column makes effect!






I wrote the above message at http://www.kendoui.com/forums/ui/grid/how-to-define-memo-style-editor-for-grid-cells.aspx#1938316



It was January 6 2012, and the current release was v2011.3.1129


[#87057] Friday, March 2, 2012, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
richardaydenc

Total Points: 148
Total Questions: 125
Total Answers: 98

Location: Seychelles
Member since Mon, Jun 28, 2021
3 Years ago
;