Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 剑道反应网格宽度为0_Reactjs_Kendo Grid_Kendo React Ui - Fatal编程技术网

Reactjs 剑道反应网格宽度为0

Reactjs 剑道反应网格宽度为0,reactjs,kendo-grid,kendo-react-ui,Reactjs,Kendo Grid,Kendo React Ui,我在我的项目中使用剑道反应。 在datagrid组件中,具有“k-grid-table”类宽度的表是0! 问题在哪里 仅当所有列宽都有宽度时,才通过所有列宽(以像素为单位)之和计算宽度。 因此,要么列为零,要么所有列的宽度都为0 以下是实际代码: Grid.prototype.resetTableWidth = function () { var totalWidth = 0; if (!this.columnResize.colGroupMain) {

我在我的项目中使用剑道反应。 在datagrid组件中,具有“k-grid-table”类宽度的表是0! 问题在哪里


仅当所有列宽都有宽度时,才通过所有列宽(以像素为单位)之和计算宽度。 因此,要么列为零,要么所有列的宽度都为0

以下是实际代码:

    Grid.prototype.resetTableWidth = function () {
    var totalWidth = 0;
    if (!this.columnResize.colGroupMain) {
        return;
    }
    var colElements = this.columnResize.colGroupMain.children;
    for (var i = 0; i < colElements.length; i++) {
        var width = colElements[i].width;
        if (!width) {
            return;
        }
        totalWidth += parseFloat(width.toString());
    }
    totalWidth = Math.round(totalWidth);
    if (this._header) {
        this._header.setWidth(totalWidth);
    }
    if (this.vs.table) {
        this.vs.table.style.width = totalWidth + 'px';
    }
};
Grid.prototype.resetTableWidth=函数(){
var totalWidth=0;
如果(!this.columnResize.colGroupMain){
返回;
}
var colElements=this.columnResize.colGroupMain.children;
对于(var i=0;i

从(当前最新开发版本)

请在问题中包含相关代码。