5.1.8 • Published 2 years ago

@axa-ch/table-sortable v5.1.8

Weekly downloads
406
License
Copyright 2019 AX...
Repository
github
Last release
2 years ago

AXA Table Sortable

WARNING: For mobile use, currently the innerscroll property must be set. This restriction will be lifted in the future.

Attention: TableSortable is for people that need a Plug&Play component, which renders out of a Model. TableSortable includes functionalities like "sortable". The Table component, instead, is for whoever needs full control of its children (React's VDOM collides with native DOM if both try to manipulate the same children, this is why we have 2 components).

Properties

AttributeDetails
innerscroll="500"Sets a min width in pixel to the table and if the viewport width is smaller than innerscroll, adds a horizontal scrollbar. This property obligatorily requires thead and tbody.
maxheight="500"(innerscroll must be set) Sets a min height in pixel for the table body. Adds a vertical scrollbar, if the list height surpasses maxheight. This property obligatorily requires thead and tbody.
model="{}"Sets the model from which the component should render. See the example below.
datesortcolumnindex="3,4"Sets the index of columns, which should be sorted as a date. Dates in the model must be in the format dd-mm-yyyy, dd/mm/yyyy or dd.mm.yyyy. Leading zeros are optional, but pay attention that a 2 digit year will be treated as following: 1.1.20 -> 01.01.0020. Multiple indices may be specified, separated by comma.

Model example:

const model = {
  thead: [
    { html: 'Title 0', sort: 'ASC' },
    { html: 'Title 1', sort: 'ASC' },
    { html: 'Title 3', sort: 'DESC' },
    { html: 'Title 2' },
    { html: 'Place', key: 'placeName', sort: 'ASC' },
  ],
  tbody: [
    [
      // Use 'html' to insert html to the table.
      { html: '<span>11 Test</span>' },
      // Use 'text' to display sanitized html.
      { text: '<span>Hello</span>' },
      { html: '<span>Cell 2</span>' },
      { html: 'A' },
      { html: '8180 Bülach', placeName: 'Bülach' },
    ],
    [
      { html: '<span>1 Test</span>' },
      { html: '<span>Z Hello 2</span>' },
      { html: '<span>Cell 2</span>' },
      { html: 'B' },
      { html: '8038 Zürich', placeName: 'Zürich' },
    ],
    [
      { html: '<span>2 Test</span>' },
      { html: '<span>A Hello 3</span>' },
      { html: '<span>Cell 2</span>' },
      { html: '8197 Rafz', placeName: 'Rafz' },
    ],
  ],
};

Events

click, onClick

The event click is fired on <table-sortable> whenever a user presses on a row

click's event detail is an object {type,index,domElement,textArray}, where type is the row type (tbody or tfoot), index is its 0-based index, domElement is the native DOM element reference (be careful in its use under React) and textArray is an array containing the text of every cell in that row.

Under React, just set a function-valued onClick callback in order to directly receive the aforementioned detail object.

Both events do not bubble up through the DOM.

5.1.8

2 years ago

5.1.7

2 years ago

5.1.6

2 years ago

5.1.5

2 years ago

5.1.4

2 years ago

5.1.3

2 years ago

5.1.2

2 years ago

5.1.1

2 years ago

5.1.0

2 years ago

4.0.1

2 years ago

4.0.2

2 years ago

5.0.2

2 years ago

5.0.1

2 years ago

5.0.0

2 years ago

4.0.0

3 years ago

3.2.16

3 years ago

3.2.15

3 years ago

3.2.14

3 years ago

3.2.13

3 years ago

3.2.12

4 years ago

3.2.11

4 years ago

3.2.10

4 years ago

3.2.9

4 years ago

3.2.8

4 years ago

3.2.7

4 years ago

3.2.6

4 years ago

3.2.5

4 years ago

3.2.3

4 years ago

3.2.2

4 years ago

3.2.1

4 years ago

3.2.0

4 years ago

3.1.0

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.1.5

4 years ago

2.1.4

5 years ago

2.1.3

5 years ago

2.1.2

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.7

5 years ago

2.0.6

5 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.3.8

5 years ago

1.3.7

5 years ago

1.3.6

5 years ago

1.3.5

5 years ago

1.3.4

5 years ago

1.3.3

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.10

5 years ago

1.2.9

5 years ago

1.2.8

5 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.10

5 years ago

1.1.9

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.2-alpha.5

5 years ago

1.1.2-alpha.4

5 years ago

1.1.2-alpha.3

5 years ago

1.1.2-alpha.2

5 years ago

1.1.2-alpha.1

5 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

1.0.0-alpha.4

6 years ago

1.0.0-alpha.3

6 years ago

1.0.0-alpha.2

6 years ago

1.0.0-alpha.1

6 years ago

0.0.0-beta.10

6 years ago

0.0.0-beta.9

6 years ago

0.0.0-beta.8

6 years ago

0.0.0-beta.7

6 years ago

0.0.0-beta.6

6 years ago

0.0.0-beta.4

6 years ago

0.0.0-beta.3

6 years ago

0.0.0-beta.2

6 years ago

0.0.0-beta.1

6 years ago