Skip to content

Commit 65873a1

Browse files
committed
adds tooltip option
1 parent 699f327 commit 65873a1

File tree

8 files changed

+304
-228
lines changed

8 files changed

+304
-228
lines changed

README.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,30 @@ Use the svelte-generic-crud-table in your component to show and, if you like, ed
2929
Just include the table as seen in the example below.
3030

3131
## column settings
32-
Settings regarding a column can be specified in the table_config:
32+
All fields are optional.
33+
34+
Settings regarding a column behaviour can be specified in the table_config.
35+
Only wanted keys of your source array have to be mapped by columns_settings *name*. All other attributes are optional.
3336
```html
3437
const table_config = {
3538
name: 'Awesome',
3639
options: ['CREATE', 'EDIT', 'DELETE', 'DETAILS'],
3740
columns_setting: [
38-
{name: 'id', show: false, edit: true, width: '200px'},
39-
{name: 'job', show: true, edit: true, width: '100px', description: 'Your job'},
40-
{name: 'name', show: true, edit: true, width: '200px',
41-
{name: 'private', show: true, edit: false, width: '200px', description: 'Your thigs'},
42-
{name: 'url', show: true, edit: true, width: '200px', type: 'html'}
43-
],
41+
{name: 'id', show: false, edit: true, width: '0px'},
42+
{name: 'job', show: true, edit: true, width: '150px', description: 'The job'},
43+
{name: 'name', show: true, edit: true, width: '150px', tooltip: true},
44+
{name: 'private', show: true, edit: false, width: '200px', description: 'your things', tooltip: true},
45+
{name: 'html', show: true, edit: true, width: '500px', type: 'html', description: 'You can use HTML'} ],
4446
details_text: 'detail' // replace the standard icon with an text-link
4547
}
4648
```
47-
- *name*: the key from your data-array. This is used as column name.
48-
- *show*: true/false; Should this column displayed?
49-
- *edit*: true/false; Set this field editable or not.
50-
- *width*: px/em; set the field width.
51-
- *description*: A tooltip for the columns name.
52-
- *type*: There are two types:
49+
- <b>*name*</b>: the key from your data-array. This is used as column name.
50+
- *show*: true/false; Should this column displayed? (optional, default: false)
51+
- *edit*: true/false; Set this field editable or not. (optional, default: false)
52+
- *width*: px/em; set the field width. (optional, default: 100px)
53+
- *description*: A tooltip for the columns name. E.g. to see the full name or other description. (optional, default: unset)
54+
- *tooltip*: true/false; When the text does not fit into the field you can show the full text as tooltip. (optional, default: false)
55+
- *type*: There are two types: (optional, default: text)
5356
- *text*: Default.
5457
- *html*: The value/text will be interpreted as HTML.
5558

@@ -155,9 +158,9 @@ Settings regarding a column can be specified in the table_config:
155158
columns_setting: [
156159
{name: 'id', show: false, edit: true, width: '200px'},
157160
{name: 'job', show: true, edit: true, width: '100px', description: 'Your Job'},
158-
{name: 'name', show: true, edit: true, width: '200px'},
161+
{name: 'name', show: true, edit: true, width: '200px', tooltip: true},
159162
{name: 'private', show: true, edit: false, width: '200px', description: 'Your things'},
160-
{name: 'html', show: true, edit: true, size: '200px', type: 'html'}
163+
{name: 'html', show: true, edit: true, size: '200px', type: 'html', tooltip: true}
161164
],
162165
details_text: 'detail' // replace the standard icon with an text-link
163166
}

dist/build/crud-table.js

Lines changed: 129 additions & 99 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)