From 78b1650c8bbdc1879ac409ddbbf9f5689145d1cc Mon Sep 17 00:00:00 2001 From: maliming Date: Tue, 8 Dec 2020 09:51:01 +0800 Subject: [PATCH] Update Data-Tables.md --- docs/en/UI/AspNetCore/Data-Tables.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/docs/en/UI/AspNetCore/Data-Tables.md b/docs/en/UI/AspNetCore/Data-Tables.md index a9dbf1eecf..b97d49d562 100644 --- a/docs/en/UI/AspNetCore/Data-Tables.md +++ b/docs/en/UI/AspNetCore/Data-Tables.md @@ -105,6 +105,32 @@ The `abp.libs.datatables.createAjax` method (used in the example above) adapts r This works automatically, so most of the times you don't need to know how it works. See the [DTO document](../../Data-Transfer-Objects.md) if you want to learn more about `IPagedAndSortedResultRequest`, `IPagedResult` and other standard interfaces and base DTO classes those are used in client to server communication. +The `createAjax` also supports you to customize request parameters and handle the responses. + +**Example:** + +````csharp +var inputAction = function () { + return { + id: $('#Id').val(), + name: $('#Name').val(), + }; +}; + +var responseCallback = function(result) { + + // your custom code. + + return { + recordsTotal: result.totalCount, + recordsFiltered: result.totalCount, + data: result.items + }; +}; + +ajax: abp.libs.datatables.createAjax(acme.bookStore.books.book.getList, inputAction, responseCallback) +```` + ### Row Actions `rowAction` is an option defined by the ABP Framework to the column definitions to show a drop down button to take actions for a row in the table. @@ -260,4 +286,4 @@ Assuming that the possible values for a column data is `f` and `m`, the `gender` ## Other Data Grids -You can use any library you like. For example, [see this article](https://community.abp.io/articles/using-devextreme-components-with-the-abp-framework-zb8z7yqv) to learn how to use DevExtreme Data Grid in your applications. \ No newline at end of file +You can use any library you like. For example, [see this article](https://community.abp.io/articles/using-devextreme-components-with-the-abp-framework-zb8z7yqv) to learn how to use DevExtreme Data Grid in your applications.