Hi,
i have problems with a json-based create method. Read is called and everything is displayed fine. But adding items does not trigger the create url. I tried adding new items wit id=0 or null or completely empty. But it is not working? What do I miss?
<script id="noDataTemplate" type="text/x-kendo-tmpl"> <div> No data found. Do you want to add new item - '#: instance.input.val() #' ? </div> <br /> <button class="k-button" onclick="addNew('#: instance.element[0].id #', '#: instance.input.val() #')">Add new item</button> </script><script> function addNew(widgetId, value) { var widget = $("#" + widgetId).getKendoMultiSelect(); var dataSource = widget.dataSource; dataSource.add({ name : value }); dataSource.sync(); } </script><script> $(document) .ready( function() { $("#title").kendoDropDownList(); $("#sex").kendoDropDownList(); var dataSource = new kendo.data.DataSource( { batch: true, transport : { read : { url : "http://XXX/tags?objectType=user", dataType : "json" }, create : { url : "http://XXX/tag/createForUser", dataType : "json", type: "POST" }, parameterMap : function(data, type) { if (type !== "read") { // send the created data items as the "models" service parameter encoded in JSON return { models : kendo .stringify(data.models) }; } } }, schema: { model: { id: "id", fields: { name: { type: "string" } } } } }); $("#tags").kendoMultiSelect( { filter : "startswith", dataTextField : "name", dataValueField : "id", dataSource : dataSource, noDataTemplate : $( "#noDataTemplate").html() }); /* $("#tags") .data("kendoMultiSelect") .value( /*[]*/ //[]); }); </script>