Transport.create
configurationThe configuration used when the data source saves newly created data items. Those are items added to the data source via the add or insert methods.
The data source uses
jQuery.ajaxto make an HTTP request to the remote service. The value configured viatransport.createis passed tojQuery.ajax. This means that you can set all options supported byjQuery.ajaxviatransport.createexcept thesuccessanderrorcallback functions which are used by the transport.
If the value of transport.create is a function, the data source invokes that function instead of jQuery.ajax. Check the jQuery documentation for more details on the provided argument.
If the value of transport.create is a string, the data source uses this string as the URL of the remote service.
- The remote service must return the inserted data items and the data item field configured as the
idmust be set. For example, if theidof the data item isProductID, the"create"server response must be[{ "ProductID": 79, "AnotherProperties": "value"}]including the ID and the other properties of the data items.- All transport actions (read, update, create, destroy) must be defined in the same way, that is, as functions or as objects. Mixing the different configuration alternatives is not possible.
transport.create
Object|String|Functiontransport.create.cache
BooleanIf set to false, the request result will not be cached by the browser. Setting cache to false will only work correctly with HEAD and GET requests. It works by appending "_={timestamp}" to the GET parameters. By default, "jsonp" requests are not cached.
Refer to the jQuery.ajax documentation for further information.
The content-type HTTP header sent to the server. The default is "application/x-www-form-urlencoded". Use "application/json" if the content is JSON. Refer to the jQuery.ajax documentation for further information.
transport.create.data
Object|FunctionAdditional parameters that are sent to the remote service. The parameter names must not match reserved words, which are used by the Kendo UI DataSource for sorting, filtering, paging, and grouping.
Refer to the jQuery.ajax documentation for further information.
The type of result expected from the server. Commonly used values are "json" and "jsonp".
Refer to the jQuery.ajax documentation for further information.
transport.create.type
StringThe type of request to make ("POST", "GET", "PUT" or "DELETE"). The default request is "GET".
The
typeoption is ignored ifdataTypeis set to"jsonp". JSONP always uses GET requests.
Refer to the jQuery.ajax documentation for further information.
Default: "GET"
transport.create.url
String|FunctionThe URL to which the request is sent.
If set to a function, the data source will invoke it and use the result as the URL.