Skip to content

Commit 66e29be

Browse files
committed
Sync with Kendo UI Professional
1 parent 8c6997a commit 66e29be

20 files changed

+527
-405
lines changed

docs/framework/datasource/crud.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
---
22
title: CRUD Data Operations
33
page_title: CRUD Data Operations - Kendo UI for jQuery DataSource
4-
description: "Learn how to use the Kendo UI for jQuery DataSource component for the create, read, update, and destroy (CRUD) data operations of your JavaScript widgets."
4+
description: "Learn how to use the Kendo UI for jQuery DataSource component for the create, read, update, and destroy (CRUD) data operations of your JavaScript components."
55
slug: cruddataoperations_kendoui_datasourcecomponent
66
position: 5
77
---
88

99
# CRUD Data Operations
1010

11-
The [Kendo UI DataSource component](https://demos.telerik.com/kendo-ui/datasource/index) fully supports CRUD (Create, Read, Update, Destroy) data operations.
11+
The [Kendo UI DataSource component](https://demos.telerik.com/kendo-ui/datasource/index) supports all CRUD (Create, Read, Update, Destroy) data operations.
1212

13-
However, it must be combined with a user interface or another Kendo UI widget such as the Grid, ListView, or other. Even though the examples in this article use the Grid as a sample, you can apply the configurations to any other widget or scenario.
13+
However, it must be combined with a user interface or another Kendo UI component such as the Grid, ListView, or other. Even though the examples in this article use the Grid as a sample, you can apply the configurations to any other component or scenario.
1414

1515
## Sample Projects and Examples
1616

@@ -22,13 +22,13 @@ However, it must be combined with a user interface or another Kendo UI widget su
2222

2323
The DataSource component can work with local data or remote data. In both cases, the CRUD operations are managed by the `transport` configuration of the DataSource.
2424

25-
`transport` is a JavaScript object that can be configured to execute predefined functions or make requests to predefined URLs on certain events. For more information, refer to the [`transport` API documentation](/api/javascript/data/datasource/configuration/transport).
25+
`transport` is a JavaScript object that can be configured to execute predefined functions or make requests to predefined URLs on some events. For more information, refer to the [`transport` API documentation](/api/javascript/data/datasource/configuration/transport).
2626

27-
> You have to define all transport actions (read, update, create, destroy) in the same way—for example, as functions (when using local or custom transport), or as objects (when using remote transport). It is not possible to mix the two configuration alternatives.
27+
> You have to define all transport actions (read, update, create, destroy) in the same way—for example, as functions (when using local or custom transport), or as objects (when using remote transport). Don't mix the two configuration alternatives.
2828
2929
## Setting the Schema
3030

31-
The `schema` of the DataSource is responsible for a number of data-connectivity actions. For more information, refer to the [`schema` API documentation](/api/javascript/data/datasource/configuration/schema).
31+
The `schema` of the DataSource handles some data-connectivity actions. For more information, refer to the [`schema` API documentation](/api/javascript/data/datasource/configuration/schema).
3232

3333
The `schema` configuration defines the following fields and field types:
3434

@@ -40,7 +40,7 @@ The `schema` configuration defines the following fields and field types:
4040

4141
You have to configure `id` for both local and remote data scenarios. You can only skip the `id` definition when all data fields are of the string type and editing is disabled.
4242

43-
The field that is used as a model ID has default values that are used by the DataSource component to identify new items. If the value of an item in the data set matches the default value, it will be considered a new item.
43+
The field that is used as a model ID has default values that are used by the DataSource component to locate new items. If the value of an item in the data set matches the default value, it will be used as a new item.
4444

4545
The default values per field type are:
4646

@@ -52,13 +52,13 @@ The `schema` configuration defines the following fields and field types:
5252
"default": ""
5353
```
5454
55-
The value of the denoted field in `schema.model.id` will also be set to the field with an `id` name in the actual data object. The field with the `id` name is a reserved field for the DataSource and will always be populated with the default value for its type or with the data from the actual data that is supplied by the developer.
55+
The value of the denoted field in `schema.model.id` will also set the field with an `id` name in the same data object. The field with the `id` name is a reserved field for the DataSource and will always be populated with the default value for its type or with the data from the supplied by the developer data.
5656
5757
* The `key`, which points to the data items array in `schema.data`—Required when the data does not represent a plain array of objects or JSON.
5858
5959
## Setting the Local CRUD Operations
6060
61-
The following information is applicable to scenarios in which the data is already available on the client, or when you will have to take care of its retrieval and submission and the DataSource will not make any HTTP requests on its own.
61+
The following information applies to scenarios in which the data is already available on the client, or when you will have to take care of its retrieval and submission and the DataSource will not make any HTTP requests on its own.
6262
6363
### Local Read Operations
6464
@@ -88,7 +88,7 @@ Executing the `success` method of the `read` function argument populates the Dat
8888
The `update` configuration setting of the DataSource defines a function that handles the updated data items which are received as a function argument. When `batch` is disabled, as it is by default, and only one data item can be updated at a time, the updated data item is received as an object in `e.data`. If `batch` is enabled and multiple data items can be updated, they are received as an array of objects in `e.data.models`. You have to execute the `success` or `error` method of the function argument at the end.
8989
9090
> * The Kendo UI DataSource uses the `ID` value to determine whether a data item is new or existing.
91-
> * If the `ID` value is `zero`, it is assumed that the data item is new so the `create` function is executed.
91+
> * If the `ID` value is `zero`, the data item will be used as new so the `create` function is executed.
9292
> * If you need to use zero `ID` values, then change the [`defaultValue`](/api/javascript/data/model/methods/define) of the ID field to `-1` (minus one) in
9393
[`schema.model.fields`](/api/javascript/data/datasource/configuration/schema.model).
9494
@@ -119,7 +119,7 @@ The `update` configuration setting of the DataSource defines a function that han
119119
The `create` function performs a similar routine as `update` with the following differences:
120120
121121
* The newly created data items have no `ID` so they must be added by the function script or returned by the remote service.
122-
* The newly created data items must be returned in the `success` method with their IDs assigned. Otherwise, the DataSource instance will operate with incorrect data and subsequent data operations can fail.
122+
* The newly created data items must be returned in the `success` method with their IDs assigned. Otherwise, the DataSource instance will run with incorrect data and later data operations can fail.
123123
* If the [`schema.data`](/api/javascript/data/datasource/configuration/schema.data) configuration is set, the `success` method receives the created data item in an object with the same structure as the object that is passed to the `success` method of the `read` function. For more information, refer to the following example and to the previous section on [local update operations](#local-update-operations).
124124
125125
<!-- exit list -->
@@ -149,7 +149,7 @@ The `create` function performs a similar routine as `update` with the following
149149
150150
### Local Destroy Operations
151151
152-
Similar to `create` and `update`, the `destroy` function receives the items that will be deleted in `e.data`. The function removes the provided items from the original DataSource and returns `success` or `error`.
152+
Like `create` and `update`, the `destroy` function receives the items that will be deleted in `e.data`. The function removes the provided items from the original DataSource and returns `success` or `error`.
153153
154154
var dataSource = new kendo.data.DataSource({
155155
transport: {
@@ -187,7 +187,7 @@ If any of the `transport` actions (read, update, create, destroy) fails, then yo
187187
188188
### Local CRUD Operations Example
189189
190-
The following example is the complete implementation based on the previous information and demonstrates CRUD operations with simple **Products** data. `original datasource` signifies the `sampleData` variable which is used to populate the Grid initially. All data operations are persisted in this variable so that it can be used or submitted somewhere else. Avoid using an [`ObservableArray`](/api/javascript/data/observablearray) instead of a plain JavaScript array in the example. The Kendo UI DataSource will wrap the provided plain array and transform it to a collection of [`ObservableObjects`](/api/javascript/data/observableobject) automatically.
190+
The following example is the complete implementation based on the previous information and demonstrates CRUD operations with simple **Products** data. `original datasource` signifies the `sampleData` variable which is used to populate the Grid initially. All data operations are persisted in this variable so that it can be reused or submitted later. Avoid using an [`ObservableArray`](/api/javascript/data/observablearray) instead of a plain JavaScript array in the example. The Kendo UI DataSource will wrap the provided plain array and transform it to a collection of [`ObservableObjects`](/api/javascript/data/observableobject) automatically.
191191
192192
```dojo
193193
<style>html { font: 12px sans-serif; }</style>
@@ -294,21 +294,21 @@ The following example is the complete implementation based on the previous infor
294294

295295
## Setting the Remote CRUD Operations
296296

297-
The following information is applicable to scenarios in which you have to retrieve the data from and submit it to a remote data service through HTTP requests that are made by the Kendo UI DataSource.
297+
The following information applies to scenarios in which you have to retrieve the data from and submit it to a remote data service through HTTP requests made by the Kendo UI DataSource.
298298

299-
CRUD operations with remote data rely on server code to perform the read, update, create, and destroy actions. Instead of configuring client functions, the `transport` of the DataSource defines remote service URLs and the expected format in which the data has to be sent and received. Theoretically, similar to the previous examples that use local data, you can use remote CRUD operations with `transport` functions but this is rarely required.
299+
CRUD operations with remote data rely on server code to perform the read, update, create, and destroy actions. Instead of configuring client functions, the `transport` of the DataSource defines remote service URLs and the expected format for sending and receiving the data. Theoretically, like the previous examples that use local data, you can use remote CRUD operations with `transport` functions but this is not a common scenario.
300300

301-
Each of the CRUD operation settings&mdash;read, update, create, destroy&mdash;provides the following common `transport` settings that you have to set accordingly. For more information, refer to the [API of the Kendo UI DataSource](/api/javascript/data/datasource).
301+
Each of the CRUD operation settings&mdash;read, update, create, destroy&mdash;provides the following common `transport` settings that you must set. For more information, refer to the [API of the Kendo UI DataSource](/api/javascript/data/datasource).
302302

303303
* The client request `type` can be `"get"` or `"post"`.
304-
* Additional optional `data` parameters can be sent to the server if needed.
304+
* You can send additional optional `data` parameters to the server if needed.
305305
* The client request and expected server response `dataType` can be `"json"`, `"jsonp"`, `"odata"`, etc.
306306

307307
### Remote Read Operations
308308

309309
The `read` service defined by the DataSource `transport` returns data in the expected JSON, JSONP, XML, or oData format. By default, the expected format is JSON. If the response is not a plain array of objects, you have to define a [`schema`](/api/javascript/data/datasource/configuration/schema) which will describe the structure of the response and [where the data is](/api/javascript/data/datasource/configuration/schema.data).
310310

311-
The following example uses a `read` transport configuration. The assumed server response is a plain JSON array of objects.
311+
The following example uses a `read` transport configuration. The required server response is a plain JSON array of objects.
312312

313313
/* Server response:
314314

@@ -535,7 +535,7 @@ If any of the `transport` actions (read, update, create, destroy) fails and erro
535535

536536
> The two approaches cannot be combined, that is, custom errors can be provided only with a `200` HTTP status code.
537537
538-
When an `error` event is fired, the DataSource does not process any data items which may also be part of the server response. For example, if an update action fails due to conflicting edits and the data needs to be refreshed from the server, call the [`read`](/api/javascript/data/datasource/methods/read) method of the DataSource in the error handler. Sending the new data together with the error response will not populate the DataSource with the new values.
538+
When an `error` event is fired, the DataSource does not process any data items that are part of the server response. For example, if an update action fails due to conflicting edits and the data needs to be refreshed from the server, call the [`read`](/api/javascript/data/datasource/methods/read) method of the DataSource in the error handler. Sending the new data together with the error response will not populate the DataSource with the new values.
539539

540540
The following example demonstrates a standard error.
541541

@@ -595,7 +595,7 @@ The following example demonstrates a custom error.
595595

596596
When you use custom transport, the create, update, and delete operations will be handled by the [`transport.submit`](/api/javascript/data/datasource/configuration/transport.submit) function in a single batch. You are also required to define `transport.read` as a function. The `transport.create`, `transport.update`, and `transport.delete` operations will not be executed in this case.
597597

598-
> In order for the defined function to invoke a single request for all read, create, update, and delete operation, set the DataSource in its [batch mode](/api/javascript/data/datasource#configuration-batch).
598+
> For the defined function to invoke a single request for all read, create, update, and delete operation, set the DataSource in its [batch mode](/api/javascript/data/datasource#configuration-batch).
599599
600600
```dojo
601601
<script>

docs/framework/datasource/overview.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ position: 1
1111

1212
The [Kendo UI DataSource component](https://demos.telerik.com/kendo-ui/datasource/index) plays a central role in all web applications built with Kendo UI for jQuery.
1313

14-
The DataSource is an abstraction for using local data (arrays of JavaScript objects) or remote data (web services returning JSON, JSONP, [oData](http://www.odata.org/), or XML). The DataSource fully supports CRUD (Create, Read, Update, Destroy) data operations and provides both client-side and server-side support for sorting, paging, filtering, grouping, and aggregates.
14+
The DataSource is an abstraction for using local data (arrays of JavaScript objects) or remote data (web services returning JSON, JSONP, [oData](http://www.odata.org/), or XML). The DataSource supports CRUD (Create, Read, Update, Destroy) data operations and provides both client-side and server-side support for sorting, paging, filtering, grouping, and aggregates.
1515

16-
> It is a known limitation that you cannot name a DataSource field "data".
16+
> A known limitation is the inability to name a DataSource field "data".
1717
1818
## Functionality and Features
1919

2020
* [DataSource Operations]({% slug datasourceoperations_kendoui_datasourcecomponent %})&mdash;The Kendo UI for jQuery DataSource provides both client-side and server-side support for sorting, paging, filtering, grouping, and aggregates.
21-
* [CRUD Operations]({% slug cruddataoperations_kendoui_datasourcecomponent %})&mdash;The DataSource component fully supports CRUD (Create, Read, Update, Destroy) data operations.
21+
* [CRUD Operations]({% slug cruddataoperations_kendoui_datasourcecomponent %})&mdash;The DataSource component supports CRUD (Create, Read, Update, Destroy) data operations.
2222
* [CORS Operations]({% slug corsdatafetching_anotherdomain_datasourcecomponent %})&mdash;With the DataSource, you can also perform Cross-Origin Resource Sharing as described in Todd Anglin's blog post from October 3, 2011.
23-
* [Offline Support]({% slug offlinesupport_kendoui_datasourcecomponent %})&mdash;The DataSource operates in an offline mode which enables data-bound Kendo UI widgets to function without an active server connection.
23+
* [Offline Support]({% slug offlinesupport_kendoui_datasourcecomponent %})&mdash;The DataSource operates in an offline mode which enables data-bound Kendo UI components to function without an active server connection.
2424
* [Hierarchical DataSource]({% slug overview_hierarchical_datasourcecomponent %})&mdash;The `HierarchicalDataSource` component allows you to represent hierarchical data.
2525

2626
## Next Steps

docs/framework/templates/essentials.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The `#` (hash) sign allows you to:
1818
* Mark areas that will be replaced by data during the template execution.
1919
* Signify the beginning and end of custom JavaScript code within the template.
2020

21-
>tip While other templating libraries include shorthand, like `{ each }`, Kendo UI does not deliver helper syntax for loops and opts for using normal JavaScript instead of custom syntax sugar because it is faster and easier for JavaScript developers.
21+
>tip While other template libraries include shorthand, like `{ each }`, Kendo UI does not deliver helper syntax for loops and opts for using normal JavaScript instead of custom syntax sugar. This is faster and easier for JavaScript developers.
2222
2323
To use the hash syntax, apply any of the following approaches:
2424
* Render values as HTML (`#= #`).
@@ -29,7 +29,7 @@ To use the hash syntax, apply any of the following approaches:
2929

3030
When you use the Kendo UI template architecture while having hash characters inside your application or website content, consider the following specifics:
3131

32-
* If your template includes a `#` character literal, which is not part of a binding expression and is not a script code marker, you must escape that character. Otherwise, it will cause a template compilation error. For example, an error will be thrown if you use a `#` inside a URL hyperlink or a CSS color value.
32+
* If your template includes a `#` character literal, which is not part of a binding expression and is not a script code marker, you must escape that character. Otherwise, it will cause a template compilation error. For example, an error will appear if you use a `#` inside a URL hyperlink or a CSS color value.
3333

3434
In JavaScript strings, you can escape the `#` literal with `\\\\#`. In external HTML script templates, you can escape the `#` literal with `\\#`.
3535

@@ -87,7 +87,7 @@ The following example demonstrates the output if, in the same scenario, you have
8787

8888
## Handling External Templates and Expressions
8989

90-
Normally, templates include expressions. While some templating frameworks invent their own re-implementation of JavaScript to provide expression sugar at the cost of performance, the Kendo UI Templates allow the execution of normal JavaScript inside templates thus favoring performance.
90+
Normally, templates include expressions. While some template frameworks invent their own re-implementation of JavaScript to provide expression sugar at the cost of performance, the Kendo UI Templates allow the execution of normal JavaScript inside templates thus favoring performance.
9191

9292
The following example demonstrates how to display a list of items by using JavaScript and Kendo UI Templates.
9393

0 commit comments

Comments
 (0)