Skip to content

Commit 6f02d7f

Browse files
committed
[update] grid column properties examples, minor fixes
1 parent 8b60d9a commit 6f02d7f

36 files changed

+121
-172
lines changed

docs/grid/api/grid_adjustcolumnwidth_method.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ grid.adjustColumnWidth("b", "header");
1919

2020
@descr:
2121

22-
If no value is set to the *adjust* parameter, the **adjustColumnWidth** method sets it to *true*.
22+
If no value is set to the `adjust` parameter, the `adjustColumnWidth()` method sets it to *true*.
2323

2424
[comment]: # (@relatedapi: grid/api/grid_adjust_config.md)

docs/grid/api/grid_aftercolumndrag_event.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ description: You can explore the afterColumnDrag event of Grid in the documentat
66

77
# afterColumnDrag
88

9-
{{pronote This functionality requires PRO version of the DHTMLX Grid (or DHTMLX Suite) package.}}
9+
:::tip pro version only
10+
The described functionality requires PRO version of the DHTMLX Grid (or DHTMLX Suite) package.
11+
:::
1012

1113
@short: fires after dragging of a column is finished
1214

docs/grid/api/grid_aftercolumndrop_event.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ description: You can explore the afterColumnDrop event of Grid in the documentat
66

77
# afterColumnDrop
88

9-
{{pronote This functionality requires PRO version of the DHTMLX Grid (or DHTMLX Suite) package.}}
9+
:::tip pro version only
10+
The described functionality requires PRO version of the DHTMLX Grid (or DHTMLX Suite) package.
11+
:::
1012

1113
@short: fires before the user has finished dragging a column but after the mouse button is released
1214

docs/grid/api/grid_afterrowresize_event.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ description: You can explore the afterRowResize event of Grid in the documentati
66

77
# afterRowResize
88

9-
{{pronote This functionality requires PRO version of the DHTMLX Grid (or DHTMLX Suite) package.}}
9+
:::tip pro version only
10+
The described functionality requires PRO version of the DHTMLX Grid (or DHTMLX Suite) package.
11+
:::
1012

1113
@short: fires after the height of a row is changed
1214

docs/grid/api/grid_spans_config.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ const grid = new dhx.Grid("grid_container", {
107107
column: "population",
108108
rowspan: 9,
109109
text: "Some text",
110-
toltipTemplate: ({ value, count }) => (`value: ${value}; count: ${count}`),
110+
tooltipTemplate: ({ value, count }) => (`value: ${value}; count: ${count}`),
111111
},
112112
],
113113
data: dataset

docs/grid/api/gridcolumn_properties/gridcolumn_adjust_property.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ adjust?: "data" | "header" | "footer" | boolean;
2323
const grid = new dhx.Grid("grid_container", {
2424
columns: [
2525
{ id: "country", header: [{ text: "Country" }], adjust: "header" },
26-
{ id: "population", header: [{ text: "Population" }] }
26+
// more columns configuration objects
2727
],
2828
adjust: false,
29-
data: dataset
29+
// more options
3030
});
3131
~~~
3232

docs/grid/api/gridcolumn_properties/gridcolumn_align_property.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ align?: "left" | "center" | "right";
2020
~~~jsx
2121
const grid = new dhx.Grid("grid_container", {
2222
columns: [
23-
{ id: "name", header: [{ text: "Name", align: "center" }], align: "right"}
24-
// more options
23+
{ id: "name", header: [{ text: "Name" }], align: "right" },
24+
// more columns configuration objects
2525
],
26-
data: dataset
26+
// more options
2727
});
2828
~~~
2929

docs/grid/api/gridcolumn_properties/gridcolumn_autowidth_property.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ autoWidth?: boolean;
2323
const grid = new dhx.Grid("grid_container", {
2424
columns: [
2525
{ id: "country", header: [{ text: "Country" }], autoWidth: false },
26-
{ id: "population", header: [{ text: "Population" }] },
26+
// more columns configuration objects
2727
],
2828
autoWidth: true,
29-
data: dataset
29+
// more options
3030
});
3131
~~~
3232

docs/grid/api/gridcolumn_properties/gridcolumn_closable_property.md

+3-12
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,18 @@ closable?: boolean;
2727
const grid = new dhx.Grid("grid_container", {
2828
columns: [
2929
{
30-
width: 150,
3130
id: "country",
3231
header: [{ text: "Country" }],
3332
// grouping of the "country" column is permanently enabled
3433
// and can't be switched off via the group panel
3534
closable: false,
3635
},
37-
{
38-
width: 150,
39-
id: "population",
40-
header: [{ text: "Population" }],
41-
groupable: true,
42-
},
43-
{ width: 150, id: "destiny", header: [{ text: "Density (P/Km²)" }] },
44-
{ width: 150, id: "area", header: [{ text: "Land Area (Km²)" }] },
36+
// more columns configuration objects
4537
],
4638
group: {
47-
order: ["country", "population"]
39+
order: [ "country" ]
4840
},
49-
groupable: true,
50-
data: dataset
41+
// more options
5142
});
5243
~~~
5344

docs/grid/api/gridcolumn_properties/gridcolumn_dateformat_property.md

+3-6
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,10 @@ dateFormat?: string;
2626
~~~jsx
2727
const grid = new dhx.Grid("grid_container", {
2828
columns: [
29-
{
30-
width: 150, id: "date", header: [{ text: "Date" }],
31-
type: "date", dateFormat: "%M %d %Y"
32-
},
33-
// more columns
29+
{ id: "date", header: [{ text: "Date" }], type: "date", dateFormat: "%M %d %Y" },
30+
// more columns configuration objects
3431
],
35-
data: dataset
32+
// more options
3633
});
3734
~~~
3835

docs/grid/api/gridcolumn_properties/gridcolumn_draggable_property.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@ draggable?: boolean;
2222
~~~jsx
2323
const grid = new dhx.Grid("grid_container", {
2424
columns: [
25-
{ width: 200, id: "country", header: [{ text: "Country" }]},
26-
{ width: 150, id: "land", header: [{ text: "Land" }] },
27-
{ width: 150, id: "density", header: [{ text: "Density" }], draggable: false }
25+
{ id: "density", header: [{ text: "Density" }], draggable: false },
26+
// more columns configuration objects
2827
],
29-
data: dataset,
3028
dragItem: "column",
29+
// more options
3130
});
3231
~~~
3332

docs/grid/api/gridcolumn_properties/gridcolumn_editable_property.md

+3-9
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,10 @@ editable?: boolean;
2222
~~~jsx
2323
const grid = new dhx.Grid("grid_container", {
2424
columns: [
25-
{
26-
width: 150, id: "project",
27-
editable: false,
28-
header: [{ text: "Project" }, { content: "selectFilter" }]
29-
},
30-
{ width: 150, id: "owner", header: [{ text: "Owner" }, { content: "inputFilter" }]},
31-
{ width: 150, id: "hours", header: [{ text: "Hours" }, { content: "inputFilter" }]},
32-
// more columns
25+
{ id: "project", header: [{ text: "Project" }], editable: false },
26+
// more columns configuration objects
3327
],
34-
editable: true
28+
editable: true,
3529
// more options
3630
});
3731
~~~

docs/grid/api/gridcolumn_properties/gridcolumn_editorconfig_property.md

+8-9
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@ The structure of the `editorConfig` object depends on the specified type of the
2121
<table>
2222
<tbody>
2323
<tr>
24-
<td><b>editorType: "combobox/multiselect"</b></td>
24+
<td><b>editorType: "<a href="../../../configuration/#combobox">combobox</a>/<a href="../../../configuration/#multiselect">multiselect"</a></b></td>
2525
<td>For this type of editor, the <b>editorConfig</b> object can include the following properties:<ul><li><b>css</b> - (optional) styling to be applied to an option</li><li><b>filter</b> - (optional) sets a custom function for filtering combobox options. Takes two parameters:<ul><li><b>item</b> - (<i>object</i>) an item of data collection</li><li><b>target</b> - (<i>string</i>) the string to compare to</li></ul> and should return <i>true/false</i> to specify whether an item should be displayed in the filtered list of options</li><li><b>eventHandlers</b> - (<i>object</i>) adds event handlers to HTML elements of a custom template of combobox items. <a href="../../../../combobox/api/combobox_eventhandlers_config/">Check the details.</a></li><li><b>itemHeight</b> - (optional) the height of an option</li><li><b>listHeight</b> - (optional) the height of the list of options</li><li><a href="../../../configuration/#editable-combobox"><b>newOptions</b></a> - (optional) allows end users to add new values into the list of combobox options from UI. The new options will also appear in the drop-down list of the header/footer filters (<i>content: "selectFilter" | "comboFilter"</i>)</li><li><b>placeholder</b> - (optional) sets a placeholder in the editor's input</li><li><b>readonly</b> - (optional) makes the editor readonly (it is only possible to select options from the list, without entering words in the input)</li><li><b>template</b> - (optional) a callback function which returns a string. It is called with an object argument which contains two properties:<ul><li><b>id</b> - the id of the selected option</li><li><b>value</b> - the value of the selected option</li></ul></li></ul></td>
2626
</tr>
2727
<tr>
28-
<td><b>editorType: "multiselect</b></td>
28+
<td><b>editorType: <a href="../../../configuration/#multiselect">"multiselect"</a></b></td>
2929
<td>For this type of editor, the <b>editorConfig</b> object can include the following properties:<ul><li><b>selectAllButton</b> - (optional) adds a button that allows selecting all the options in the editor</li></ul></td>
3030
</tr>
3131
<tr>
32-
<td><b>editorType:"datePicker"</b> and column <b>type:"date"</b></td>
32+
<td><b>editorType:<a href="../../../configuration/#datepicker">"datePicker"</a></b> and column <b>type:"date"</b></td>
3333
<td>For this type of editor, the <b>editorConfig</b> object can include the following properties:<ul><li><b>asDateObject</b> - (optional) sets the date picker mode that presupposes saving a date as a Date object</li></ul> and <a href="../../../../category/calendar-properties/">a set of properties of Calendar</a> (except for the <b>value</b> and <b>range</b> ones)</td>
3434
</tr>
3535
<tr>
36-
<td><b>editorType:"input"</b> and column <b>type:"number"</b></td>
36+
<td><a href="../../../configuration/#editing-columns-with-the-number-type"><b>editorType:</b><b>"input"</b> and column <b>type:"number"</b></a></td>
3737
<td>For this combination, the <b>editorConfig</b> object can include the following properties:<ul><li><b>min</b> - (optional) the minimum allowed value</li><li><b>max</b> - (optional) the maximum allowed value</li></ul></td>
3838
</tr>
3939
</tbody>
@@ -46,17 +46,16 @@ The structure of the `editorConfig` object depends on the specified type of the
4646
const grid = new dhx.Grid("grid_container", {
4747
columns: [
4848
{
49-
width: 150,
5049
id: "status",
51-
header: [{text: "Status"}, {content: "selectFilter"}],
50+
header: [{ text: "Status" }],
5251
editorType: "combobox",
5352
// enables the ability to add new values into the combobox editor of the "Status" column
5453
editorConfig: { newOptions: true },
55-
options: ["Done", "In Progress", "Not Started"]
54+
options: [ "Done", "In Progress", "Not Started" ]
5655
},
57-
// more columns
56+
// more columns configuration objects
5857
],
59-
data: dataset
58+
// more options
6059
});
6160
~~~
6261

docs/grid/api/gridcolumn_properties/gridcolumn_editortype_property.md

+4-8
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,12 @@ editorType?: "input" | "select" | "datePicker" | "combobox" | "multiselect" | "t
2828
~~~jsx
2929
const grid = new dhx.Grid("grid_container", {
3030
columns: [
31-
{
32-
width: 150, id: "project",
33-
header: [{ text: "Project" }, { content: "selectFilter" }],
34-
editorType: "textarea"
35-
}
36-
// more columns
31+
{ id: "project", header: [{ text: "Project" }], editorType: "textarea" },
32+
// more columns configuration objects
3733
],
38-
data: data,
3934
editable: true,
40-
autoHeight: true
35+
autoHeight: true,
36+
// more options
4137
});
4238
~~~
4339

docs/grid/api/gridcolumn_properties/gridcolumn_footer_property.md

+6-12
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ Each footer object may include:
4646
<td><a href="../../../configuration/#headerfooter-text"><b>text</b></a></td><td>(optional) the text of a footer or a callback function which is called with the following parameter:<ul><li><b>content</b> - an object with the content of the footer tooltip that contains the calculated values as *key:value* pairs, where:<ul><li>the *key* is either the key defined in the list or the functor name</li><li>the *value* can be a *string/number* or *null*</li></ul> The calculated values are taken either from the <b>summary</b> config option of the component or the <b>summary</b> config option of a column</li></ul></td>
4747
</tr>
4848
<tr>
49-
<td><b>tooltip</b></td><td>(optional) enables/disables the footer 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></td>
49+
<td><a href="../../../configuration/#column-headerfooter-tooltip"><b>tooltip</b></a></td><td>(optional) enables/disables the footer 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></td>
5050
</tr>
5151
<tr>
5252
<td><a href="../../../configuration/#column-headerfooter-tooltip"><b>tooltipTemplate</b></a></td><td>(optional) sets a template for the footer tooltip. Takes into account the <a href="../../../configuration/#html-content-of-grid-columns">htmlEnable</a> property. The value of the <b>tooltipTemplate</b> property is a callback function which is called with the following parameters:<ul><li><b>content</b> - an object with the content of the footer tooltip. Contains two properties which are available either from the component's or from the column's configuration:<ul><li><b>value</b> - the value rendered in a cell, including the applied templates</li><li>an object with the calculated values of the <b>summary</b> property, set as *key:value* pairs where:<ul><li>the *key* is either the key defined in the list or the functor name</li><li>the *value* can be a *string/number* or *null*</li></ul></li></ul></li><li><b>footer</b> - the object of the column footer</li><li><b>column</b> - the object of a column</li></ul>Return <i>false</i> to disable the tooltip</td>
5353
</tr>
5454
<tr>
55-
<td><b>align</b></td><td>(optional) aligns data in the footer: "left" | "center" | "right", <i>"left"</i> by default</td>
55+
<td><a href="../../../configuration/#alignment"><b>align</b></a></td><td>(optional) aligns data in the footer: "left" | "center" | "right", <i>"left"</i> by default</td>
5656
</tr>
5757
<tr>
5858
<td><b>colspan</b></td><td>(optional) the number of columns in a colspan</td>
@@ -64,7 +64,7 @@ Each footer object may include:
6464
<td><b>css</b></td><td>(optional) styling to be applied to a footer</td>
6565
</tr>
6666
<tr>
67-
<td><b>htmlEnable</b></td><td>(optional) <i>false</i> by default. If set to <i>true</i>, allows using and displaying HTML content in a footer. If set to <i>false</i>, the content of the footer cells will be displayed as a <i>string</i> value</td>
67+
<td><a href="../../../configuration/#html-content-of-grid-columns"><b>htmlEnable</b></a></td><td>(optional) <i>false</i> by default. If set to <i>true</i>, allows using and displaying HTML content in a footer. If set to <i>false</i>, the content of the footer cells will be displayed as a <i>string</i> value</td>
6868
</tr>
6969
</tbody>
7070
</table>
@@ -75,16 +75,10 @@ Each footer object may include:
7575
~~~jsx
7676
const grid = new dhx.Grid("grid_container", {
7777
columns: [
78-
{
79-
width: 150,
80-
id: "population",
81-
header: [{ text: () => `<mark>Population</mark>`, htmlEnable: true }],
82-
footer: [{ text: ({ totalPopulation, count }) => `Total: ${totalPopulation}, Count: ${count}` }],
83-
summary: "count"
84-
}
78+
{ id: "country", header: [{ text: "Country" }], footer: [{ text: "Total" }] },
79+
// more columns configuration objects
8580
],
86-
summary: { totalPopulation: ["population", "sum"] },
87-
data: dataset
81+
// more options
8882
});
8983
~~~
9084

docs/grid/api/gridcolumn_properties/gridcolumn_gravity_property.md

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const grid = new dhx.Grid("grid_container", {
2323
{ id: "density", header: [{ text: "Density (P/Km²)" }], gravity: 1 },
2424
// the column with the "area" id is two times wider than the column with the "density" id
2525
{ id: "area", header: [{ text: "Land Area (Km²)" }], gravity: 2 },
26+
// more columns configuration objects
2627
],
2728
autoWidth: true,
2829
// more options

docs/grid/api/gridcolumn_properties/gridcolumn_groupable_property.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@ groupable?: boolean;
2323
const grid = new dhx.Grid("grid_container", {
2424
columns: [
2525
{ id: "country", header: [{ text: "Country" }], groupable: true },
26-
{ id: "population", header: [{ text: "Population" }] },
27-
{ id: "area", header: [{ text: "Land Area (Km²)" }] }
26+
// more columns configuration objects
2827
],
2928
group: true,
30-
data: dataset
29+
// more options
3130
});
3231
~~~
3332

0 commit comments

Comments
 (0)