1.10.2 • Published 6 months ago

kimia-fdx-table v1.10.2

Weekly downloads
-
License
MIT
Repository
bitbucket
Last release
6 months ago

FDX-Table

This is a JS component created as a solution to solve the needs of the FDX company about statistics.

Getting started

Javascript

// Previous import with webpack
import 'kimia-fdx-table/app/styles/fdx-table-main.css';
import FdxTable from 'kimia-fdx-table';

// 1: Set options
let options = {
    ajaxURL: "/url-get-updated-data-ajax", // URL used to get updated data by ajax
    ajaxExportURL: '/url-get-data-to-export-ajax', // URL used to get exported data by ajax
    buttons: ["csv"],
    data: {
        info: {
            sortBy: (string),
            sortOrder: (string),
            pageSize: (int),
            pageNumber: (int),
        },
        list: [
            // Registros a listar
            {aggregation_column: (string), column_1: (int | string), column_2: (int | string)}
        ],
        params: {
            aggregation: "aggregation_key",
            filters: {column_key: "string value"},
            limit: (int),
            page: (int),
            searchColumn: "column_key",
            searchText: "string value",
            sortBy: "column_key",
            sortOrder: "ASC|DESC",
        },
        totals: {aggregation_column: "Empty string", column_1: (int | string), column_2: (int | string)},
    },
    columnDefs: {
        columns: [
            {"type": "group", "name": "Group"}, // Column used by your aggregation
            {"type": "column_key", "name": "Column shown string", prefix: "$|%"}
        ],
        tooltips: [
            {"type": "column_key", "text": "Column description"},
        ],
        bigColumns: [],
        smallColumns: [],
        enableSorting: ["column_key_1", "column_key_2", "column_key_3"],
        availableAggregations: [
            {"type": "column_key", "name": "Column shown string"}
        ]
    },
};

// 2: Declare table
let table = new FdxTable("#table-container-id", options);

// 3: Build
table.build();

HTML

<div id="#table-container-id"></div>

Option's description

ParameterTypeDescription
ajaxURLstringRequired. URL used to get updated data by ajax
ajaxExportURLstringRequired. URL used to get exported data by ajax
buttonsarrayButtons array
data.infojsonRequired. Parameters used to create pagination and info label
data.listarrayRequired. Rows to be rendered
data.paramsjsonRequired. Params sent to the endpoint wich returns the data
data.totalsjsonColumn totals
columnDefs.columnsjson[]Required. Each element into the array is a json with the column data
columnDefs.tootipsjson[]Each element into the array has a column description
columnDefs.bigColumnsarrayColumn keys that will be bigger than other
columnDefs.smallColumnsarrayColumn keys that will be smaller than other
columnDefs.enableSortingarrayColumn keys that will be enabled to sort table
columnDefs.availableAggregationsjson[]Enabled aggregations

FdxTable(string id, object options)

  • ID: Is the container id where the table will be rendered.
  • options: This object contains necessary data and parameters to render the table.

Installation

Install component in my-project with npm

  cd my-project
  npm i kimia-fdx-table

Support

For support, email fake@fake.com.

Authors

1.10.2

6 months ago

1.8.0

9 months ago

1.9.0

9 months ago

1.10.0

9 months ago

1.7.9

1 year ago

1.7.8

1 year ago

1.7.7

1 year ago

1.7.6

1 year ago

1.7.5

1 year ago

1.7.4

2 years ago

1.6.11

2 years ago

1.6.12

2 years ago

1.7.3

2 years ago

1.7.2

2 years ago

1.7.1

2 years ago

1.7.0

2 years ago

1.6.4

2 years ago

1.6.3

2 years ago

1.6.2

2 years ago

1.6.1

2 years ago

1.6.0

2 years ago

1.6.9

2 years ago

1.6.8

2 years ago

1.6.10

2 years ago

1.6.7

2 years ago

1.6.6

2 years ago

1.6.5

2 years ago

1.5.9

2 years ago

1.5.8

2 years ago

1.5.7

2 years ago

1.5.6

2 years ago

1.5.5

2 years ago

1.5.4

2 years ago

1.5.3

2 years ago

1.5.2

2 years ago

1.5.1

2 years ago

1.5.0

2 years ago

1.4.6

2 years ago

1.4.5

2 years ago

1.4.4

2 years ago

1.4.3

2 years ago

1.4.2

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago