Kendo ui grid filed with editor, popup does not close

I have a field in my kendo ui grid that the editor uses:

columns:[{ field:"Nome", title: "Nome" },{ field: "idTipoQuarto", title:"Tipo de Quarto", editor: tipoQuartoEditor}, 

In my model, I have:

 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 }} } } } 

And my editor function:

 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" } } }) }); } 

I see the values โ€‹โ€‹when the popup window opens in a dropdown list, and I can publish the selected data to my database when I click the update / insert button, but the popup window does not disappear. This shows me an error that I do not understand:

 Object {xhr: Object, status: "parsererror", errorThrown: SyntaxError: Unexpected token A, sender: ht.extend.init, _defaultPrevented: falseโ€ฆ} 

What I'm missing here, I saw another message, but no luck adapting to my problem.

Is anyone

Thanks for your time, welcome

0
source share

Source: https://habr.com/ru/post/1490389/


All Articles