Hello,
We're currently evaluating Kendo UI and we've jumped on a strange issue. When using fields with dropdown widgets, the grid sends a not serialized JavasSript object, which basically the string "[object Object]". I've tried to serialize this data by myself, using `parameterMap(options)`, but even there the values were already two "[object Object]" string. Checkout the screenshot I've attached.
I've created a static example in order to present you the issue more easily. This my data store:
I initialize the grid in an empty div
I use jQuery 1.8.3, the latest version of KendoUI Web and this is how the external resources are loaded.:
Cheers,
Kiril Vladimirov
We're currently evaluating Kendo UI and we've jumped on a strange issue. When using fields with dropdown widgets, the grid sends a not serialized JavasSript object, which basically the string "[object Object]". I've tried to serialize this data by myself, using `parameterMap(options)`, but even there the values were already two "[object Object]" string. Checkout the screenshot I've attached.
I've created a static example in order to present you the issue more easily. This my data store:
kendo.django_stores = {};
kendo.django_stores.RoomTypeDataStore =
new
kendo.data.DataSource({
"sort"
: [],
"serverPaging"
:
false
,
"serverFiltering"
:
false
,
"serverSorting"
:
false
,
"pageSize"
:
null
,
"transport"
: {
"read"
: {
"dataType"
:
"json"
,
"type"
:
"GET"
},
"destroy"
: {
"dataType"
:
"json"
,
"type"
:
"POST"
},
"create"
: {
"dataType"
:
"json"
,
"type"
:
"POST"
},
"update"
: {
"dataType"
:
"json"
,
"type"
:
"POST"
}
},
"schema"
: {
"type"
:
"json"
,
"model"
: {
"fields"
: {
"capacity"
: {
"nullable"
:
false
,
"defaultValue"
: 0,
"editable"
:
true
,
"values"
: [],
"validation"
: {
"required"
:
true
},
"type"
:
"number"
},
"name"
: {
"nullable"
:
false
,
"defaultValue"
:
null
,
"editable"
:
true
,
"values"
: [
{
"text"
:
"Single room"
,
"value"
:
"single"
},
{
"text"
:
"Double room"
,
"value"
:
"double"
}
],
"validation"
: {
"required"
:
true
},
"type"
:
"string"
},
"hotel"
: {
"nullable"
:
false
,
"defaultValue"
:
null
,
"editable"
:
true
,
"values"
: [],
"validation"
: {
"required"
:
true
},
"type"
:
"string"
},
"pk"
: {
"editable"
:
false
,
"nullable"
:
true
},
"breakfast"
: {
"nullable"
:
false
,
"defaultValue"
:
null
,
"editable"
:
true
,
"values"
: [
{
"text"
:
"With breakfast"
,
"value"
:
"breakfast"
},
{
"text"
:
"With continential breakfast"
,
"value"
:
"continential"
},
{
"text"
:
"With buffet breakfast"
,
"value"
:
"buffet"
},
{
"text"
:
"With English breakfast"
,
"value"
:
"English"
},
{
"text"
:
"Without breakfast"
,
"value"
:
"without"
}
],
"validation"
: {
"required"
:
true
},
"type"
:
"string"
},
"id"
: {
"nullable"
:
false
,
"defaultValue"
:
null
,
"editable"
:
true
,
"values"
: [],
"validation"
: {
"required"
:
false
},
"type"
:
"string"
}
},
"id"
:
"pk"
},
"total"
:
"total"
,
"data"
:
"results"
}
});
<
div
id
=
"rooms_grid"
></
div
>
$(document).ready(
function
() {
var
RoomTypeDataStore = kendo.django_stores.RoomTypeDataStore;
var
fields = RoomTypeDataStore.options.schema.model.fields;
$(
'#rooms_grid'
).kendoGrid({
dataSource: RoomTypeDataStore,
height: 800,
sortable:
true
,
scrollable:
true
,
editable:
'popup'
,
destroyable:
true
,
toolbar: [
"create"
],
columns: [
{field:
"name"
, title:
"Name"
, values: fields.name.values},
{field:
"capacity"
, title:
"Capacity"
, format:
"{0:n0}"
},
{field:
"breakfast"
, title:
"Breakfast"
, values: fields.breakfast.values},
{command: [
"edit"
,
"destroy"
]}
]
});
});
<link href=
"./static/styles/kendo.common.min.css"
rel=
"stylesheet"
type=
"text/css"
>
<link href=
"./static/styles/kendo.default.min.css"
rel=
"stylesheet"
type=
"text/css"
>
<script type=
"text/javascript"
src=
"./static/js/jquery.js"
charset=
"utf-8"
></script>
<script type=
"text/javascript"
src=
"./static/js/kendo.web.min.js"
charset=
"utf-8"
></script>
Kiril Vladimirov