Hello,
Im getting a problem that i can't resolve.
So i have a grid, and in one of the field i have a dropdownlist (filled with an other Datasource)
When i select a data in the dropdownlist it works except when i create a new line, when i select a data in the dropdownlist, i got in the grid [object Object]
I'm asking how to put in the grid the data i selected in the dropdownlist (SellToName).
here is my code
DataSource:
Grid and DropdownList
Thank you.
Im getting a problem that i can't resolve.
So i have a grid, and in one of the field i have a dropdownlist (filled with an other Datasource)
When i select a data in the dropdownlist it works except when i create a new line, when i select a data in the dropdownlist, i got in the grid [object Object]
I'm asking how to put in the grid the data i selected in the dropdownlist (SellToName).
here is my code
DataSource:
var customers = [
{NUMBER:"P001",SellToName:"test1"},
{NUMBER:"U001",SellToName:"test2"}
]
var businessList = [
{ NUMBER: "A5678", SellToCustomerNumber: "NOV" }
]
$(document).ready(function () {
//chargement customer list format json
var customerDataSource = new kendo.data.DataSource({
data: customers
});
//chargement business list format json
var businessListDataSource = new kendo.data.DataSource({
data: businessList
});
//on initialise la grid
$("#grid").kendoGrid({
dataSource: businessListDataSource,
pageable: true,
navigatable: true,
groupable: true,
sortable: true,
height: 700,
toolbar: ["create"],
columns: [
{ field:"NUMBER",title:"Numero"},
{ field: "SellToName", title: "Nom", editor: numberDropDownEditor },
{ command: "destroy", title: " ", width: "90px"}],
editable: true
});
function numberDropDownEditor(container, options) {
$('<
input
required
=
"required"
data-text-field
=
"SellToName"
data-value-field
=
"SellToName"
data-bind
=
"value:' + options.field + '"
/>')
.appendTo(container)
.kendoDropDownList({
autoBind: false,
dataSource: customerDataSource
}
);
}
});