Add enableTreeView flag
This commit is contained in:
parent
25e2c6cc35
commit
7683892142
5
dist/frappe-datatable.cjs.js
vendored
5
dist/frappe-datatable.cjs.js
vendored
@ -2541,7 +2541,7 @@ class CellManager {
|
|||||||
contentHTML = cell.column.format(cell.content, cell);
|
contentHTML = cell.column.format(cell.content, cell);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(isHeader || isFilter) && cell.indent !== undefined) {
|
if (this.options.enableTreeView && !(isHeader || isFilter) && cell.indent !== undefined) {
|
||||||
const nextRow = this.datamanager.getRow(cell.rowIndex + 1);
|
const nextRow = this.datamanager.getRow(cell.rowIndex + 1);
|
||||||
const addToggle = nextRow && nextRow.meta.indent > cell.indent;
|
const addToggle = nextRow && nextRow.meta.indent > cell.indent;
|
||||||
|
|
||||||
@ -3339,7 +3339,8 @@ var DEFAULT_OPTIONS = {
|
|||||||
layout: 'ratio', // fixed, fluid, ratio
|
layout: 'ratio', // fixed, fluid, ratio
|
||||||
noDataMessage: 'No Data',
|
noDataMessage: 'No Data',
|
||||||
cellHeight: null,
|
cellHeight: null,
|
||||||
enableInlineFilters: false
|
enableInlineFilters: false,
|
||||||
|
enableTreeView: false
|
||||||
};
|
};
|
||||||
|
|
||||||
class DataTable {
|
class DataTable {
|
||||||
|
|||||||
5
dist/frappe-datatable.js
vendored
5
dist/frappe-datatable.js
vendored
@ -2540,7 +2540,7 @@ class CellManager {
|
|||||||
contentHTML = cell.column.format(cell.content, cell);
|
contentHTML = cell.column.format(cell.content, cell);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(isHeader || isFilter) && cell.indent !== undefined) {
|
if (this.options.enableTreeView && !(isHeader || isFilter) && cell.indent !== undefined) {
|
||||||
const nextRow = this.datamanager.getRow(cell.rowIndex + 1);
|
const nextRow = this.datamanager.getRow(cell.rowIndex + 1);
|
||||||
const addToggle = nextRow && nextRow.meta.indent > cell.indent;
|
const addToggle = nextRow && nextRow.meta.indent > cell.indent;
|
||||||
|
|
||||||
@ -3338,7 +3338,8 @@ var DEFAULT_OPTIONS = {
|
|||||||
layout: 'ratio', // fixed, fluid, ratio
|
layout: 'ratio', // fixed, fluid, ratio
|
||||||
noDataMessage: 'No Data',
|
noDataMessage: 'No Data',
|
||||||
cellHeight: null,
|
cellHeight: null,
|
||||||
enableInlineFilters: false
|
enableInlineFilters: false,
|
||||||
|
enableTreeView: false
|
||||||
};
|
};
|
||||||
|
|
||||||
class DataTable {
|
class DataTable {
|
||||||
|
|||||||
@ -2540,7 +2540,7 @@ class CellManager {
|
|||||||
contentHTML = cell.column.format(cell.content, cell);
|
contentHTML = cell.column.format(cell.content, cell);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(isHeader || isFilter) && cell.indent !== undefined) {
|
if (this.options.enableTreeView && !(isHeader || isFilter) && cell.indent !== undefined) {
|
||||||
const nextRow = this.datamanager.getRow(cell.rowIndex + 1);
|
const nextRow = this.datamanager.getRow(cell.rowIndex + 1);
|
||||||
const addToggle = nextRow && nextRow.meta.indent > cell.indent;
|
const addToggle = nextRow && nextRow.meta.indent > cell.indent;
|
||||||
|
|
||||||
@ -3338,7 +3338,8 @@ var DEFAULT_OPTIONS = {
|
|||||||
layout: 'ratio', // fixed, fluid, ratio
|
layout: 'ratio', // fixed, fluid, ratio
|
||||||
noDataMessage: 'No Data',
|
noDataMessage: 'No Data',
|
||||||
cellHeight: null,
|
cellHeight: null,
|
||||||
enableInlineFilters: false
|
enableInlineFilters: false,
|
||||||
|
enableTreeView: false
|
||||||
};
|
};
|
||||||
|
|
||||||
class DataTable {
|
class DataTable {
|
||||||
|
|||||||
10
index.html
10
index.html
File diff suppressed because one or more lines are too long
@ -687,7 +687,7 @@ export default class CellManager {
|
|||||||
contentHTML = cell.column.format(cell.content, cell);
|
contentHTML = cell.column.format(cell.content, cell);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(isHeader || isFilter) && cell.indent !== undefined) {
|
if (this.options.enableTreeView && !(isHeader || isFilter) && cell.indent !== undefined) {
|
||||||
const nextRow = this.datamanager.getRow(cell.rowIndex + 1);
|
const nextRow = this.datamanager.getRow(cell.rowIndex + 1);
|
||||||
const addToggle = nextRow && nextRow.meta.indent > cell.indent;
|
const addToggle = nextRow && nextRow.meta.indent > cell.indent;
|
||||||
|
|
||||||
|
|||||||
@ -47,5 +47,6 @@ export default {
|
|||||||
layout: 'ratio', // fixed, fluid, ratio
|
layout: 'ratio', // fixed, fluid, ratio
|
||||||
noDataMessage: 'No Data',
|
noDataMessage: 'No Data',
|
||||||
cellHeight: null,
|
cellHeight: null,
|
||||||
enableInlineFilters: false
|
enableInlineFilters: false,
|
||||||
|
enableTreeView: false
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user