Skip to main content
Version: 1.9.0

ReadOnlyTable

Overview

The ReadOnlyTable component allows the user to display a read-only mode table.


Specification

Property

Here is a list of properties that can be used for modifying the component:

NameTypeDefaultDescriptionRemark
classNamestring""Component class name
idstring""Component id name
labelstring""Label for the componentLabel is not displayed if unspecified or empty
rowsPerPagenumber5Number of table rows per pageRound off to the nearest whole number when the decimal point is set
Will result an error if the value of rowsPerPage is not a positive integer
paginationbooleantrueShow/Hide the paginationIf setting false, pagination is hidden and all rows are displayed
If setting true, pagination is displayed and only the number of rows set in rowsPerPage are displayed
visiblebooleantrueShow/Hide the component
columnsArray<Column>[]Column data of the componentWill result an error if the value of columns is not an array
dataArray<object>[]Row data of the componentWill result an error if the value of data is not an array

Column

NameTypeDefaultDescriptionRemark
fieldstring""Key of the columnIt represents the key of the data object
The value associated with that key will be rendered in the column
titlestring""Header name of the column
visiblebooleantrueShow/Hide the column

Constructor

ReadOnlyTable(options)
Here is a list of available constructors:

Parameter

NameTypeDefaultDescriptionRemark
optionsobject{}Object that includes component properties

Sample Code

tip

Please check the package installation method first.

Here is a sample code when all parameters are specified:

const Kuc = Kucs['1.x.x'];

const space = kintone.app.record.getSpaceElement('space');

const readOnlyTable = new ReadOnlyTable({
label: 'ReadOnlyTable',
columns: [
{
title: 'Number',
field: 'index',
},
{
title: 'City',
field: 'name',
},
{
title: 'Country',
field: 'country',
},
{
title: 'Population',
field: 'population',
},
{
title: 'Coordinates',
field: 'coordinates',
}
],
data: [
{
index: '1',
name: 'HoChiMinh',
country: 'Vietnam',
population: '8,371,000',
coordinates: '10.762622, 106.660172',
},
{
index: '2',
name: 'Tokyo',
country: 'Japan',
population: '14,000,000',
coordinates: '35.689487, 139.691711',
},
{
index: '3',
name: 'New York',
country: 'USA',
population: '8,400,000',
coordinates: '40.712776, -74.005974',
}
],
className: 'sample-class',
id: 'sample-id',
visible: true,
pagination: true,
rowsPerPage: 3,
});
space.appendChild(readOnlyTable);