You're viewing the legacy site. Visit cxjs.io/docs for the latest documentation. Legacy site. Visit cxjs.io/docs for new docs.

Documentation

Report Edit

Grid with Pagination

Grid control is commonly combined with server-side sorting, filtering and pagination.

NamePhoneCity
Walter Hane269-332-9944New Zaneport
Wellington Steuber588-899-2261New Noemy
Kyle Stroman645-361-5132South Hubertstad
Roberta Jewess720-394-4365Port Joannie
Angeline Torp762-804-7780Kennaborough
Uriel Parisian506-360-7005New Lyric
Jessica Witting131-029-1083Glendaville
Thaddeus Kutch433-588-5558Willismouth
Toney Stamm678-940-8590Kaneview
Shanna Bashirian351-384-8392West Juliet
1
2
3
4
5
ControllerIndex
<Grid records-bind='$page.records'
    style={{width: "100%"}}
    mod="bordered"
    lockColumnWidths
    columns={[
        {
            field: 'fullName',
            sortable: true,
            header1: 'Name',
            header2: {
                allowSorting: false,
                items: <TextField value-bind="$page.filter.name" reactOn="enter blur"
                                    style="width:100%"/>
            }
        },
        {
            header1: 'Phone',
            header2: {
                items: <TextField value-bind="$page.filter.phone" reactOn="enter blur"
                                    style="width:100%"/>
            },
            field: 'phone'
        },
        {
            header1: 'City',
            header2: {
                allowSorting: false,
                items: <TextField value-bind="$page.filter.city" reactOn="enter blur"
                                    style="width:100%"/>
            },
            field: 'city',
            sortable: true
        }
    ]}
    sorters-bind="$page.sorters"
    remoteSort
/>

<div style={{marginTop: '20px'}}>
    <Pagination page-bind="$page.page" pageCount-bind="$page.pageCount"/>
    <Select value-bind="$page.pageSize" style={{float: 'right'}}>
        <option value="5">5</option>
        <option value={10}>10</option>
        <option value="20">20</option>
        <option value="50">50</option>
    </Select>
</div>
Copied!Cx Fiddle
PropertyDescriptionType
length

Number of page buttons to be displayed. Default is 5.

number
page

Currently selected page.

number
pageCount

Total number of pages.

number
baseClass

Base CSS class to be applied to the field. Defaults to pagination.

string
class
className

Additional CSS classes to be applied to the element. If an object is provided, all keys with a "truthy" value will be added to the CSS class list.

string/object
mod

Appearance modifier. For example, mod="big" will add the CSS class .cxm-big to the block element.

string/array
outerLayout

Defines the outer layout which wraps the widget.

widget
putInto
contentFor

Used with outer layouts. Specifies the name of the content placeholder which should render the widget.

string
style

Style object applied to the wrapper div. Used for setting the dimensions of the element.

string/object
vdomKey

Key that will be used as the key when rendering the React component.

string
visible
if

Visibility of the widget. Defaults to true.

boolean