Skip to content

Commit 7b4d811

Browse files
authored
Merge pull request #5 from DHTMLX/8.4-grid-columns-naming-4493
Change "col" to "columns", fix params and examples for Grid and TreeGrid docs
2 parents bbe0f1e + 093415a commit 7b4d811

File tree

164 files changed

+763
-552
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+763
-552
lines changed

docs/grid/api/api_gridcolumn_properties.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ columns:[
2020
{
2121
text?: string | number,
2222
tooltip?: boolean | object, // true by default
23-
tooltipTemplate?: (value: string | undefined, header: IHeader, col: ICol) => string | boolean,
23+
tooltipTemplate?: (value: string | undefined, header: object, column: object) => string | boolean,
2424
align?: "left" | "center" | "right", // "left" by default
2525
colspan?: number,
2626
rowspan?: number,
@@ -45,7 +45,7 @@ columns:[
4545
{
4646
text?: string | number,
4747
tooltip?: boolean | object, // true by default
48-
tooltipTemplate?: (value: string | undefined, footer: IFooter, col: ICol) => string | boolean,
48+
tooltipTemplate?: (value: string | undefined, footer: object, column: object) => string | boolean,
4949
align?: "left" | "center" | "right", // "left" by default
5050
colspan?: number,
5151
rowspan?: number,
@@ -59,7 +59,7 @@ columns:[
5959
editorType?: "input" | "select" | "datePicker" | "combobox" | "multiselect" | "textarea",
6060
format?: string,
6161
options?: (string | { id: string | number, value: string })[] |
62-
(col: object, row?: object) => (string | { id: string | number, value: string })[],
62+
(column: object, row?: object) => (string | { id: string | number, value: string })[],
6363
editorConfig?: obj,
6464
adjust?: "data" | "header" | "footer" | boolean, // false by default
6565
align?: "left" | "center" | "right", // "left" by default
@@ -71,9 +71,9 @@ columns:[
7171
sortable?: boolean, // true by default
7272
mark?: { min?: string, max?: string } |
7373
(cell: any, columnCells: any[], row?: object, column?: object) => string,
74-
template?: (cellValue: any, row: object, col: object) => string,
74+
template?: (cellValue: any, row: object, column: object) => string,
7575
tooltip?: boolean | object, // true by default
76-
tooltipTemplate?: (cellValue: any, row: object, col: object) => string,
76+
tooltipTemplate?: (cellValue: any, row: object, column: object) => string,
7777
},
7878
// more column objects
7979
]
@@ -125,7 +125,7 @@ columns:[
125125
</tr>
126126
<tr>
127127
<td><b>options</b></td>
128-
<td>(optional) specifies a set of options to be displayed in the editor of a cell. It is required if you specify <a href="../../configuration/#types-of-column-editor">editorType: "select" | "combobox" | "multiselect"</a>. The property can be:<ul><li>an array of string values</li><li>an array of objects with a set of <i>key:value</i> pairs - attributes of options and their values:<ol>The <b>id</b> attribute sets the id for the option</ol><ol>The <b>value</b> attribute sets the value to be displayed both in the editor and in the grid cell. If the id of the option is specified in the data set, the value will also be displayed in the cell on Grid initialization</ol></li><li>a function which takes two parameters:<ol><b>col</b> - (required) an object with the configuration of a column</ol><ol><b>row</b> - (optional) an object with all cells in a row</ol>and must return either an array of string values or an array of objects</li></ul><b>Related Samples:</b><ul><li><a href="https://snippet.dhtmlx.com/w2cdossn" target="_blank">Grid. Editing with different editors (combobox, select, multiselect, boolean, date)</a></li><li><a href="https://snippet.dhtmlx.com/i22fg83z" target="_blank">Grid. Individual option lists for select, multiselect and combobox editors</a></li></ul>If <b>newOptions</b> property is enabled, all new options will be displayed in the editor regardless of the initialized options.</td>
128+
<td>(optional) specifies a set of options to be displayed in the editor of a cell. It is required if you specify <a href="../../configuration/#types-of-column-editor">editorType: "select" | "combobox" | "multiselect"</a>. The property can be:<ul><li>an array of string values</li><li>an array of objects with a set of <i>key:value</i> pairs - attributes of options and their values:<ol>The <b>id</b> attribute sets the id for the option</ol><ol>The <b>value</b> attribute sets the value to be displayed both in the editor and in the grid cell. If the id of the option is specified in the data set, the value will also be displayed in the cell on Grid initialization</ol></li><li>a function which takes two parameters:<ol><b>column</b> - (required) an object with the configuration of a column</ol><ol><b>row</b> - (optional) an object with all cells in a row</ol>and must return either an array of string values or an array of objects</li></ul><b>Related Samples:</b><ul><li><a href="https://snippet.dhtmlx.com/w2cdossn" target="_blank">Grid. Editing with different editors (combobox, select, multiselect, boolean, date)</a></li><li><a href="https://snippet.dhtmlx.com/i22fg83z" target="_blank">Grid. Individual option lists for select, multiselect and combobox editors</a></li></ul>If <b>newOptions</b> property is enabled, all new options will be displayed in the editor regardless of the initialized options.</td>
129129
</tr>
130130
<tr>
131131
<td id="editorconfig"><b>editorConfig</b></td>
@@ -165,19 +165,19 @@ columns:[
165165
</tr>
166166
<tr>
167167
<td><a href="../../customization#adding-custom-marks-to-cells"><b>mark</b></a></td>
168-
<td>(optional) can be either an object or a function:<ul><li>as an <i>object</i> contains <b>min</b> and <b>max</b> properties, to apply desired CSS classes to cells with minimal|maximal values in a column </li><li>as a <i>function</i> returns a template for marking a cell(s) and takes several parameters:<ul><li><b>cell</b> - (required) the value of a cell</li><li><b>columnCells</b> - (required) an array of all cell values in the specified column</li><li><b>row</b> - (optional) an object with all cells in a row</li><li><b>col</b> - (optional) an object with the configuration of a column (see the <b>columns</b> config)</li></ul></li></ul><br><b>Related Sample: </b><a href="https://snippet.dhtmlx.com/buirf16n" target="_blank">Grid. Mark cells</a></td>
168+
<td>(optional) can be either an object or a function:<ul><li>as an <i>object</i> contains <b>min</b> and <b>max</b> properties, to apply desired CSS classes to cells with minimal|maximal values in a column </li><li>as a <i>function</i> returns a template for marking a cell(s) and takes several parameters:<ul><li><b>cell</b> - (required) the value of a cell</li><li><b>columnCells</b> - (required) an array of all cell values in the specified column</li><li><b>row</b> - (optional) an object with all cells in a row</li><li><b>column</b> - (optional) an object with the configuration of a column (see the <b>columns</b> config)</li></ul></li></ul><br><b>Related Sample: </b><a href="https://snippet.dhtmlx.com/buirf16n" target="_blank">Grid. Mark cells</a></td>
169169
</tr>
170170
<tr>
171171
<td><a href="../../customization#adding-template-to-cells"><b>template</b></a></td>
172-
<td>(optional) a function which returns a template with content for a cell(s). Takes 3 parameters:<ul><li><b>cellValue</b> - (required) the value of a cell</li><li><b>row</b> - (required) an object with all cells in a row</li><li><b>col</b> - (required) an object with the configuration of a column (see the <b>columns</b> config)</li></ul><br><b>Related Sample: </b><a href="https://snippet.dhtmlx.com/9txizaow" target="_blank">Grid. Cell templates</a></td>
172+
<td>(optional) a function which returns a template with content for a cell(s). Takes 3 parameters:<ul><li><b>cellValue</b> - (required) the value of a cell</li><li><b>row</b> - (required) an object with all cells in a row</li><li><b>column</b> - (required) an object with the configuration of a column (see the <b>columns</b> config)</li></ul><br><b>Related Sample: </b><a href="https://snippet.dhtmlx.com/9txizaow" target="_blank">Grid. Cell templates</a></td>
173173
</tr>
174174
<tr>
175175
<td><a href="../../configuration#tooltip"><b>tooltip</b></a></td>
176176
<td>(optional) enables/disables the header tooltip, or sets the configuration object with the tooltip settings; <i>true</i> by default. When set as an object, the <b>tooltip</b> config can have the following properties:<ul><li><b>force</b> - (optional) forces opening of a tooltip; if set to true, the <b>showDelay</b> and <b>hideDelay</b> settings are ignored, *false* by default</li><li><b>showDelay</b> - (optional) the time period that should pass before showing a tooltip, in ms</li><li><b>hideDelay</b> - (optional) the time period that should pass before hiding a tooltip, in ms</li><li><b>margin</b> - (optional) the margin between the node and tooltip; *8px* by default</li><li><b>position</b> - (optional) the position of a tooltip: *"right"*, *"bottom"*, *"center"*, *"left"*, *"top"*; *"bottom"* by default</li><li><b>css</b> - (optional) the style of a tooltip box</li></ul>The **tooltip** config can be redefined for the header/footer tooltip</td>
177177
</tr>
178178
<tr>
179179
<td><a href="../../customization#adding-template-to-tooltip"><b>tooltipTemplate</b></a></td>
180-
<td>(optional) a function which returns a template for the content of the tooltip. Takes 3 parameters:<ul><li><b>value</b> - (required) the value of a cell</li><li><b>row</b> - (required) an object with all cells in a row</li><li><b>col</b> - (required) an object with the configuration of a column (see the <b>columns</b> config)</li></ul>Returning *false* from the function will block showing of the tooltip</td>
180+
<td>(optional) a function which returns a template for the content of the tooltip. Takes 3 parameters:<ul><li><b>value</b> - (required) the value of a cell</li><li><b>row</b> - (required) an object with all cells in a row</li><li><b>column</b> - (required) an object with the configuration of a column (see the <b>columns</b> config)</li></ul>Returning *false* from the function will block showing of the tooltip</td>
181181
</tr>
182182
</tbody>
183183
</table>

docs/grid/api/grid_addspan_method.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: You can explore the addSpan method of Grid in the documentation of
88

99
@short: adds a rows/cols span
1010

11-
@signature: addSpan(spanObj: object): void;
11+
@signature: {'addSpan(spanObj: object): void;'}
1212

1313
@params:
1414
- `spanObj: object` - an object with configuration of a span. The object contains the following properties:

docs/grid/api/grid_aftercolumndrag_event.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,17 @@ description: You can explore the afterColumnDrag event of Grid in the documentat
1313
@signature: {'afterColumnDrag: (data: object, events: MouseEvent) => void;'}
1414

1515
@params:
16-
- `data: object` - data object. It contains the following parameters:
16+
17+
The callback of the event is called with the following parameters:
18+
19+
- `data: object` - data object. It contains the following properties:
1720
- `start: string | number` - the id of a column, from which the dragging process has started
1821
- `source: array` - an array with ids of dragged columns
1922
- `target: string | number` - the id of a potential target column
20-
- `events: MouseEvent` - a native HTML event object
23+
- `event: MouseEvent` - a native HTML event object
2124

2225
@example:
23-
grid.events.on("afterColumnDrag", function(data, events) {
26+
grid.events.on("afterColumnDrag", (data, event) => {
2427
// your logic here
2528
});
2629

docs/grid/api/grid_aftercolumndrop_event.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@ description: You can explore the afterColumnDrop event of Grid in the documentat
1313
@signature: {'afterColumnDrop: (data: object, events: MouseEvent) => void;'}
1414

1515
@params:
16-
- `data: object` - data object. It contains the following parameters:
16+
The callback of the event is called with the following parameters:
17+
18+
- `data: object` - data object. It contains the following properties:
1719
- `start: string | number` - the id of a column, from which the dragging process has started
1820
- `source: array` - an array with ids of dragged columns
1921
- `target: string | number` - the id of a potential target column
20-
- `events: MouseEvent` - a native HTML event object
22+
- `event: MouseEvent` - a native HTML event object
2123

2224
@example:
23-
grid.events.on("afterColumnDrop", function(data, events) {
25+
grid.events.on("afterColumnDrop", (data, event) => {
2426
// your logic here
2527
});
2628

docs/grid/api/grid_aftercolumnhide_event.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ description: You can explore the afterColumnHide event of Grid in the documentat
88

99
@short: fires after a column is hidden
1010

11-
@signature: {'afterColumnHide: (col: object) => void;'}
11+
@signature: {'afterColumnHide: (column: object) => void;'}
1212

1313
@params:
14-
- `col: object` - an object with a column configuration
14+
The callback of the event is called with the following parameters:
15+
16+
- `column: object` - an object with a column configuration
1517

1618
@example:
17-
grid.events.on("afterColumnHide", function(column){
19+
grid.events.on("afterColumnHide", (column) => {
1820
// your logic here
1921
});
2022

docs/grid/api/grid_aftercolumnshow_event.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ description: You can explore the afterColumnShow event of Grid in the documentat
88

99
@short: fires after a column is shown
1010

11-
@signature: {'afterColumnShow: (col: object) => void;'}
11+
@signature: {'afterColumnShow: (column: object) => void;'}
1212

1313
@params:
14-
- `col: object` - an object with a column configuration
14+
The callback of the event is called with the following parameters:
15+
- `column: object` - an object with a column configuration
1516

1617
@example:
17-
grid.events.on("afterColumnShow", function(column){
18+
grid.events.on("afterColumnShow", (column) => {
1819
// your logic here
1920
});
2021

docs/grid/api/grid_aftereditend_event.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ description: You can explore the afterEditEnd event of Grid in the documentation
88

99
@short: fires after editing of a cell is ended
1010

11-
@signature: {'afterEditEnd: (value: string | number | boolean, row: object, col: object) => void;'}
11+
@signature: {'afterEditEnd: (value: string | number | boolean, row: object, column: object) => void;'}
1212

1313
@params:
14+
The callback of the event is called with the following parameters:
15+
1416
- `value: string | number | boolean` - the new value of a cell
1517
- `row: object` - an object with a row configuration
16-
- `col: object` - an object with a column configuration
18+
- `column: object` - an object with a column configuration
1719

1820
@example:
19-
grid.events.on("afterEditEnd", function(value,row,column){
21+
grid.events.on("afterEditEnd", (value, row, column) => {
2022
// your logic here
2123
});
2224

docs/grid/api/grid_aftereditstart_event.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ description: You can explore the afterEditStart event of Grid in the documentati
88

99
@short: fires after editing of a cell has started
1010

11-
@signature: {'afterEditStart: (row: object, col: object, editorType: "input" | "select" | "datePicker" | "checkbox" | "combobox" | "textarea" | "multiselect") => void;'}
11+
@signature: {'afterEditStart: (row: object, column: object, editorType: "input" | "select" | "datePicker" | "checkbox" | "combobox" | "textarea" | "multiselect") => void;'}
1212

1313
@params:
14+
The callback of the event is called with the following parameters:
15+
1416
- `row: object` - an object with a row configuration
15-
- `col: object` - an object with a column configuration
17+
- `column: object` - an object with a column configuration
1618
- `editorType: string` - the type of a cell editor: "input", "select", "datePicker", "checkbox", "combobox", "textarea", "multiselect"
1719

1820
@example:
19-
grid.events.on("afterEditStart", function(row,col, editorType){
21+
grid.events.on("afterEditStart", (row, column, editorType) => {
2022
// your logic here
2123
});
2224

docs/grid/api/grid_afterkeydown_event.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ description: You can explore the afterKeyDown event of Grid in the documentation
88

99
@short: fires after the user is pressing a shortcut key
1010

11-
@signature: {'afterKeyDown: (e: Event) => void;'}
11+
@signature: {'afterKeyDown: (event: Event) => void;'}
1212

1313
@params:
14-
- `e: Event` - a native KeyboardEvent object
14+
The callback of the event is called with the following parameter:
15+
16+
- `event: Event` - a native KeyboardEvent object
1517

1618
@example:
17-
grid.events.on("afterKeyDown", function (e) {
19+
grid.events.on("afterKeyDown", (event) => {
1820
// your logic here
1921
});
2022

docs/grid/api/grid_afterresizeend_event.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ description: You can explore the afterResizeEnd event of Grid in the documentati
88

99
@short: fires after resizing of a column is ended
1010

11-
@signature: {'afterResizeEnd: (col: object, e: MouseEvent) => void;'}
11+
@signature: {'afterResizeEnd: (column: object, event: MouseEvent) => void;'}
1212

1313
@params:
14-
- `col: object` - an object with a column configuration
15-
- `e: MouseEvent` - a native HTML event object
14+
The callback of the event is called with the following parameters:
15+
16+
- `column: object` - an object with a column configuration
17+
- `event: MouseEvent` - a native HTML event object
1618

1719
@example:
18-
grid.events.on("afterResizeEnd", function(col,e){
20+
grid.events.on("afterResizeEnd", (column, event) => {
1921
// your logic here
2022
});
2123

0 commit comments

Comments
 (0)