Skip to content

Commit eda39a0

Browse files
committed
minor fixes examples readme
1 parent 9e0802d commit eda39a0

File tree

5 files changed

+24
-19
lines changed

5 files changed

+24
-19
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Just include the table as seen in the example below.
6868
<table-pager></table-pager>
6969
```
7070

71-
### Svelte-Component:
71+
### Svelte-Component - implementation example:
7272
```
7373
import SvelteGenericCrudTable from "svelte-generic-crud-table";
7474
import GenericTablePager from "svelte-generic-table-pager";
@@ -85,14 +85,16 @@ Just include the table as seen in the example below.
8585
get().then( (result) => {
8686
myData = result;
8787
}).catch((error) => {
88-
// throw new Error('refresh');
8988
}).finally(() =>{
90-
//--- initialize the component ---!
91-
let elem = document.getElementById('right');
92-
elem.click();
89+
initComponent();
9390
});
9491
}
9592
93+
function initComponent() {
94+
let elem = document.getElementById('right');
95+
elem.click();
96+
}
97+
9698
function handleCreate(event) {
9799
post({name: "new entry"})
98100
.then(() => {

dist/crud-table-config-html.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ let table_config = {
33
name: 'Awesome',
44
options: ['CREATE', 'EDIT', 'DELETE', 'DETAILS'],
55
columns_setting: [
6-
{name: 'id', show: false, edit: true, width: '200px'},
7-
{name: 'job', show: true, edit: true, width: '100px'},
8-
{name: 'name', show: true, edit: true, width: '200px'},
9-
{name: 'private', show: true, edit: false, width: '200px'}
6+
{name: 'id', show: false, edit: true, size: '200px'},
7+
{name: 'job', show: true, edit: true, size: '200px'},
8+
{name: 'name', show: true, edit: true, size: '200px'},
9+
{name: 'private', show: true, edit: false, size: '200px'}
1010
]
1111
}
1212

@@ -31,7 +31,6 @@ genericCrudTable.addEventListener('details', (e) => {
3131
genericCrudTable.addEventListener('update', (e) => {
3232
console.log('update');
3333
console.log(e.detail.body);
34-
let BreakException = {};
3534
for(let i = 0; i < myData.length; i++) {
3635
if (JSON.stringify(myData[i]) === JSON.stringify(table_data[e.detail.id])) {
3736
myData[i] = e.detail.body;

dist/test-data.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ let myData = [
66
{id: '131', name: 'John', job: 'tester', private: 'books'},
77
{id: '132', name: 'Alice', job: 'code', private: 'OSS'},
88
{id: '133', name: 'Nicole', job: 'design', private: 'painting'},
9+
{id: '128', name: 'myRealName', job: 'hmm', private: 'personal info'},
10+
{id: '129', name: 'Your Name', job: 'no', private: '122/456789'},
11+
{id: '130', name: 'Jim', job: 'code', private: '[email protected]'},
12+
{id: '131', name: 'John', job: 'tester', private: 'books'},
13+
{id: '132', name: 'Alice', job: 'code', private: 'OSS'},
14+
{id: '133', name: 'Nicole', job: 'design', private: 'painting'},
15+
{id: '128', name: 'myRealName', job: 'hmm', private: 'personal info'},
16+
{id: '129', name: 'Your Name', job: 'no', private: '122/456789'},
17+
{id: '130', name: 'Jim', job: 'code', private: '[email protected]'},
18+
{id: '131', name: 'John', job: 'tester', private: 'books'},
19+
{id: '132', name: 'Alice', job: 'code', private: 'OSS'},
20+
{id: '133', name: 'Nicole', job: 'design', private: 'painting'},
921
{id: '134', name: 'Denis', job: 'coder', private: 'sports'},
1022
{id: '135', name: 'Marc', job: 'trainer', private: 'rc models'},
1123
{id: '136', name: 'Timme', job: 'diverse', private: 'timme'},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "svelte-generic-crud-table",
3-
"version": "1.5.20",
3+
"version": "1.5.21",
44
"description": "<crud-table> renders object-arrays with options-panel and inline edit per row. Dispatches events for ongoing data handling. As self-containing webcomponent or for Svelte in 60KB",
55
"main": "dist/build/crud-table.js",
66
"module": "dist/build/crud-table.mjs",

src/SvelteGenericCrudTable.svelte

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@
136136
dispatcher('sort', column, event);
137137
}
138138
139-
140139
</script>
141140

142141
<main>
@@ -424,11 +423,4 @@
424423
max-height: 1.3em;
425424
}
426425
427-
.disable-css-transitions {
428-
-webkit-transition: none !important;
429-
-moz-transition: none !important;
430-
-o-transition: none !important;
431-
transition: none !important;
432-
}
433-
434426
</style>

0 commit comments

Comments
 (0)