fix: column resizing in rtl direction

This commit is contained in:
Faris Ansari 2022-01-17 16:36:58 +05:30
parent 4549a5176b
commit 95a239963c
3 changed files with 11 additions and 1 deletions

View File

@ -189,6 +189,7 @@
dynamicRowHeight: true, dynamicRowHeight: true,
treeView: treeView, treeView: treeView,
showTotalRow: true, showTotalRow: true,
// direction: 'rtl',
// language: 'myLang', // language: 'myLang',
// translations: { // translations: {
// myLang: { // myLang: {

View File

@ -174,7 +174,11 @@ export default class ColumnManager {
const onMouseMove = (e) => { const onMouseMove = (e) => {
if (!isDragging) return; if (!isDragging) return;
const finalWidth = startWidth + (e.pageX - startX); let delta = e.pageX - startX;
if (this.options.direction === 'rtl') {
delta = -1 * delta;
}
const finalWidth = startWidth + delta;
const { const {
colIndex colIndex
} = $.data($resizingCell); } = $.data($resizingCell);

View File

@ -164,6 +164,11 @@
} }
} }
.datatable[dir=rtl] .dt-cell__resize-handle {
right: unset;
left: -3px;
}
.icon-open, .icon-close { .icon-open, .icon-close {
width: 16px; width: 16px;
height: 16px; height: 16px;