Kendo ui grid filed with editor, pop up won´t close

最后都变了- 提交于 2019-12-11 15:04:46

问题


I have a field on my kendo ui grid which uses an editor:

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 is:

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 can see the values when my popup is opened in the drop-down list, and i can post the selections to my database when clicking on the update/insert button, but the popup won´t disappear. It shows me an error that i don´t understand:

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

What am i missing here, i have seen another post but with no luck adapting to my problem.

Anyone?

Thanks for your time, regards

来源:https://stackoverflow.com/questions/29675921/kendo-ui-grid-filed-with-editor-pop-up-won%c2%b4t-close

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!