Kendo ui 剑道ui网格与编辑器一起归档,弹出窗口赢得´;关不上
我的剑道ui网格上有一个使用编辑器的字段:Kendo ui 剑道ui网格与编辑器一起归档,弹出窗口赢得´;关不上,kendo-ui,kendo-grid,kendo-mobile,Kendo Ui,Kendo Grid,Kendo Mobile,我的剑道ui网格上有一个使用编辑器的字段: columns:[{ field:"Nome", title: "Nome" },{ field: "idTipoQuarto", title:"Tipo de Quarto", editor: tipoQuartoEditor}, 在我的模型中,我有: schema: { data: "data", total: function(response) {
columns:[{ field:"Nome", title: "Nome" },{ field: "idTipoQuarto", title:"Tipo de Quarto", editor: tipoQuartoEditor},
在我的模型中,我有:
schema:
{
data: "data",
total: function(response)
{
return $(response.data).length;
},
model:
{
id: "idQuarto",
fields:
{
idQuarto: { editable: false, nullable: true },
Nome: { validation: { required: true } },
idTipoQuarto: { validation: { required: true }}
}
}
}
我的编辑器功能是:
function tipoQuartoEditor(container, options)
{
$('<input data-text-field="Nome" data-value-field="Nome" data-bind="value:' + options.field + '"/>').appendTo(container).kendoDropDownList({
autoBind: false,
dataSource: new kendo.data.DataSource({
transport:
{
read:
{
url: "data/quartos.php",
},
parameterMap: function(options, operation)
{
if (operation !== "read" && options.models)
{
return {models: kendo.stringify(options.models)};
}
}
},
schema:
{
data: "data",
model:
{
id: "idTipoQuarto",
value: "Nome"
}
}
})
});
}
我在这里遗漏了什么,我已经看到了另一篇文章,但没有运气适应我的问题
有人吗
感谢您抽出时间,在按下Update之后,在API中处理好业务之后,您需要返回刚刚更新的新对象。这个新对象需要与剑道模式模型接受的类型相同。您很可能没有返回正确的内容,因此kendo无法正确解析对象。更新后返回的
data/quartos.php
是什么?似乎它返回的任何东西都无法解析。伙计们,谢谢你们的帮助,但我的问题很愚蠢!愚蠢的!,我忘了从我的quartos.php中删除打印内容……现在一切都正常了。谢谢你的帮助,gitsitgo和OnaBai。
Object {xhr: Object, status: "parsererror", errorThrown: SyntaxError: Unexpected token A, sender: ht.extend.init, _defaultPrevented: false…}