[ADF-2102] Task List - Provide a way to support custom html template and static columns at same time (#2787)

* * Removed unused adf-task-list keys from app.config
* Fix can add/remove the static property through the app.config and can put custom columns into the html in adf-tasklist component

* Fix add/remove the static property through the app.config and can put custom columns into the html in adf-tasklist component

* * Fixed support custom html template and static columns.
* Updated tasklist doc.
* Fixed failing test case.

* * Fixed support custom html template and static columns

* * Updated task-list documentation.
This commit is contained in:
siva kumar
2017-12-15 19:23:30 +05:30
committed by Maurizio Vitale
parent fe84522ce2
commit a5e6d9abcf
4 changed files with 101 additions and 70 deletions

View File

@@ -11,6 +11,38 @@ Renders a list containing all the tasks matched by the parameters specified.
[assignment]="'assignee'">
</adf-tasklist>
```
You can pass schema as data adapter for the tasklist like shown below :
```ts
let data = new ObjectDataTableAdapter(
// Row data
[
{ id: 1, name: 'Name 1' },
{ id: 2, name: 'Name 2' }
],
// Column schema
[
{
type: 'text',
key: 'id',
title: 'Id',
sortable: true
},
{
type: 'text',
key: 'name',
title: 'Name',
sortable: true
}
]
);
```
```html
<adf-tasklist
[data]="'data'">
</adf-tasklist>
```
You can also use HTML-based schema declaration like shown below:
@@ -23,9 +55,9 @@ You can also use HTML-based schema declaration like shown below:
</adf-tasklist>
```
You can also use custom schema declaration as shown below:
You can also use static custom schema declaration as shown below:
define custom schema in the app.config.json as shown below json format.
define static custom schema in the app.config.json as shown below json format.
```json
"adf-task-list": {
@@ -53,6 +85,42 @@ define custom schema in the app.config.json as shown below json format.
[presetColumn]="'customSchema'">
</adf-tasklist>
```
You can also use both HTML-based and app.config.json custom schema declaration at same time like shown below:
```json
"adf-task-list": {
"presets": {
"customSchema": [
{
"key": "id",
"type": "text",
"title": "Id",
"sortable": true
}],
"default": [
{
"key": "name",
"type": "text",
"title": "name",
"sortable": true
}],
}
}
```
```html
<adf-tasklist
[appId]="'1'"
[presetColumn]="'customSchema'">
<data-columns>
<data-column key="assignee" title="Assignee" class="full-width name-column">
<ng-template let-entry="$implicit">
<div>{{getFullName(entry.row.obj.assignee)}}</div>
</ng-template>
</data-column>
</data-columns>
</adf-tasklist>
```
### Properties
| Name | Type | Default | Description |