fix(treeView): Decrease left padding of tree node cells

This commit is contained in:
Faris Ansari 2018-07-08 17:35:16 +05:30
parent 9e4d0bb9c8
commit 2cf2191f0f
2 changed files with 4 additions and 3 deletions

View File

@ -773,13 +773,14 @@ export default class CellManager {
if (this.options.treeView && !(isHeader || isFilter) && cell.indent !== undefined) {
const nextRow = this.datamanager.getRow(cell.rowIndex + 1);
const addToggle = nextRow && nextRow.meta.indent > cell.indent;
const leftPadding = 1;
// Add toggle and indent in the first column
const firstColumnIndex = this.datamanager.getColumnIndexById('_rowIndex') + 1;
if (firstColumnIndex === cell.colIndex) {
const padding = ((cell.indent || 0) + 1) * 1.5;
const padding = ((cell.indent || 0) + 1) * leftPadding;
const toggleHTML = addToggle ?
`<span class="dt-tree-node__toggle" style="left: ${padding - 1.5}rem"></span>` : '';
`<span class="dt-tree-node__toggle" style="left: ${padding - leftPadding}rem"></span>` : '';
contentHTML = `<span class="dt-tree-node" style="padding-left: ${padding}rem">
${toggleHTML}${contentHTML}</span>`;
}

View File

@ -193,7 +193,7 @@
display: inline-block;
position: absolute;
font-size: 10px;
padding: 0 4px;
padding: 2px;
cursor: pointer;
}