devextreme
Version:
JavaScript/TypeScript Component Suite for Responsive Web Development
28 lines (27 loc) • 1.46 kB
JavaScript
/**
* DevExtreme (esm/__internal/grids/grid_core/views/utils.js)
* Version: 26.1.6
* Build date: Fri Oct 16 2026
*
* Copyright (c) 2012 - 2026 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
import {
columnHasValue
} from "../../../grids/grid_core/columns_controller/columns_controller_utils";
import gridCoreUtils from "../m_utils";
const INVISIBLE_CLASS = "dx-state-invisible";
export const getCellText = (column, displayValue) => columnHasValue(column) ? gridCoreUtils.formatValue(displayValue, column) : "";
export const getMaxHorizontalScrollOffset = container => container ? Math.round(container.scrollWidth - container.clientWidth) : 0;
export const isSameColumnLayout = (renderedColumns, columns) => renderedColumns.length === columns.length && renderedColumns.every((column, index) => column.index === columns[index].index && column.command === columns[index].command);
export const isRowElementVisible = rowElement => "none" !== rowElement.style.display && !rowElement.classList.contains(INVISIBLE_CLASS);
export const insertRowElement = ($newRow, $rows, rowIndex, $table) => {
const $row = $rows.eq(rowIndex);
if ($row.length) {
$newRow.insertBefore($row)
} else if ($rows.length) {
$newRow.insertAfter($rows.last())
} else if ($table) {
$newRow.prependTo($newRow.is("tbody") ? $table : $table.children("tbody"))
}
};