jsgrid
Description
The jsgrid part allows you to display data in a grid format.
Use
You can use the jsgrid part to show data to the user in a grid format, and you can customize the grid to allow users to edit the data. Most of the functionality is executed on the client side, which makes the jsgrid faster than other grids.
Tips & Tricks
Keyboard Navigation
In the jsgrid users can navigate through rows using the up and down arrow keys on the keyboard, and they can use the space bar button to edit the selected row. When in edit mode, users can click the tab and tab+shift buttons to switch focus between the columns. Clicking Ctrl+Enter saves the row and the Escape button cancels all changes.
If you press the down or up arrow keys while the row is still in edit mode, the system will open the row above or below in edit mode. If you have unsaved changes in the selected row, the system will show you a message asking you to save the row and continue, continue without saving, or cancel and go to the next/previous row.
Edit Field Pop-Up
To be able to easily edit large texts, you can double-click on a field when in edit mode, or you can press the Insert key to trigger a pop-up with a text area. In this text area you can edit the text and press the Save or Cancel buttons. When typing text in the text area field, you can also press Enter to save or press Escape to cancel.
Submit/Cancel Buttons
You can choose to show a submit and/or cancel button at the top of the grid. The Submit button submits all the changes a user made in the grid to the server. The Cancel button reverts all changes the user made to the grid since the last submit. The Submit and Cancel buttons are be disabled at first. When you make a change, the buttons are enabled. After you press Submit the system disables the buttons because there are no pending changes to save or revert.
Input Validation
The jsgrid supports field validation, which can be configured in the part. You can choose if the validation should trigger on render and/or on blur, and it will always trigger when saving a row. If you choose to enable validation on render, the system will display in red the fields that contain validation errors. When you hover over the field the system displays validation the error message. If you choose to enable validation on blur, the system will display in red the field when you leave the edit field. When you save the row and it still contains validation errors, a pop-up message will be shown with the validation errors. These errors have to be resolved before the row can be saved.
Unsaved Data Warning
If you choose to turn activate validation the system will display warning messages if the user leaves the page or row without saving their changes. When you leave a row you edited but did not save, the system displays a message saying there are unsaved changes and providing three options: save the row and continue, continue without saving, or cancel. If you try to leave with unsaved changes the system will prompt you to continue or cancel.
Editor Fields
Tab |
Field Name |
Description/Use |
Type/Options |
Optional/Mandatory |
Basic |
Collection |
This is the data object that contains the collection to show in the grid. |
Data Object |
Mandatory |
Basic |
Grid caption |
This is the caption the system will display at the top of the grid. |
Text |
Optional |
Basic |
Columns |
These are the columns that will make up the grid. Each column can have one of the following types:
|
Collection |
Mandatory |
Basic |
Add rows |
|
Yes | No |
Mandatory |
Basic |
Delete rows |
|
Yes | No |
Mandatory |
Basic |
Allow editing |
|
Yes | No |
Mandatory |
Basic |
Allow sorting |
|
Yes | No |
Mandatory |
Basic |
Submit on row save |
|
Yes | No |
Mandatory |
Basic |
Show submit button |
|
Yes | No |
Mandatory |
Basic |
Submit button caption |
If "Show submit button" is set to Yes, this is the caption of the submit button the system will display. |
Text |
Optional |
Basic |
Show cancel button |
|
Mandatory |
|
Basic |
Cancel button caption |
If "Show cancel button" is set to Yes this is the caption of the cancel button the system will display. |
Text |
Optional |
Basic |
Allow column resizing |
|
Mandatory |
|
Basic |
Show pop-up to edit on double click field |
|
Yes | No |
Mandatory |
Basic |
Popup save button caption |
This is the caption the system displays if "Show pop-up to edit on double click field" is set to Yes. |
Text |
Optional |
Basic |
Popup cancel button caption |
This is the caption the system displays on the cancel button if "Show pop-up to edit on double click field" is set to Yes. |
Text |
Optional |
Basic |
Use paging |
|
Yes | No |
Mandatory |
Basic |
Page size |
This is the number of rows the system will display on one page. This only applies when "Use paging" is set to Yes. |
Number |
Optional |
Basic |
Show (un)select all button |
|
Yes | No |
Mandatory |
Basic |
Column name |
This is the name of the column to be Selected/Unselected. This only applies when "Show (un)select all button" is set to Yes. |
Text |
Optional |
Basic |
Select all button caption |
This is the caption of the Select All button. It only applies when "Show (un)select all button" is set to Yes. |
Text |
Optional |
Basic |
Unselect all button caption |
This is the caption of the Unselect All button. It only applies when "Show (un)select all button" is set to Yes. |
Text |
Optional |
Warnings |
Show warning for unsaved data when leaving row |
|
Yes | No |
Optional |
Warnings |
Leaving row warning title |
This is the title of the warning message box when "Show warning for unsaved data when leaving row" is set to Yes. |
Text |
Optional |
Warnings |
Leaving row warning message |
This is the warning message the system displays when "Show warning for unsaved data when leaving row" is set to Yes. |
Text |
Optional |
Warnings |
Save row button text |
This is the caption of the save row button. It only applies when "Show warning for unsaved data when leaving row" is set to Yes. |
Text |
Optional |
Warnings |
Continue button text |
This is the caption of the Continue button. It only applies when "Show warning for unsaved data when leaving row" is set to Yes. |
Text |
Optional |
Warnings |
Cancel button text |
This is the caption of the Cancel button. It only applies when "Show warning for unsaved data when leaving row" is set to Yes. |
Text |
Optional |
Warnings |
Show warning for unsaved data when leaving page |
|
Optional |
|
Warnings |
Leaving page warning title |
The title of the warning message box. Only applies when "Show warning for unsaved data when leaving page" is set to Yes. |
Text |
Optional |
Warnings |
Leaving page warning message |
This is the warning message the system displays when "Show warning for unsaved data when leaving page" is set to Yes. |
Text |
Optional |
Warnings |
Confirm button text |
This is the caption of the confirm button. It only applies when "Show warning for unsaved data when leaving page" is set to Yes. |
Text |
Optional |
Warnings |
Cancel button text |
This is the caption of the cancel button. It only applies when "Show warning for unsaved data when leaving page" is set to Yes. |
Text |
Optional |
Warnings |
On click selector for leaving page |
This is the JavaScript/jQuery on-click selector for detecting when users are leaving a page. For example, "input[type='button']". When a user clicks a button the system displays the warning. |
Text |
Optional |
Validation |
Validate on render |
|
Yes | No |
Mandatory |
Validation |
Validate on blur |
|
Yes | No |
Mandatory |
Validation |
Validation error title message box |
This is the title of the message box for validation errors. |
Text |
Optional |
Validation |
Validation error header message |
This is the header text of the message box for validation errors. |
Text |
Optional |
Validation |
Columns validation |
This is a collection of column names with the specified validation rule. Possible validation rules include:
|
Collection |
Optional |
Style |
Padding left (in px) |
This field lets you set the padding in pixels on the left side of the grid. |
Number |
Optional |
Style |
Padding right (in px) |
This field lets you set the padding in pixels right side of the grid. |
Number |
Optional |
Example
Please download and import the example project in your workspace.