Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/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
React data grid React数据网格并不总是在最后几列上显示值_React Data Grid - Fatal编程技术网

React data grid React数据网格并不总是在最后几列上显示值

React data grid React数据网格并不总是在最后几列上显示值,react-data-grid,React Data Grid,我的屏幕越小,没有值的列就越多。只要我手动调整屏幕的宽度(通过将其拉大或拉小),所有的值都会显示出来。这好像是一个错误。我附上了两张照片,显示了html如何在相邻单元格中显示,有值和无值显示 | 我们找到的解决方案是将minColumnWidth:10添加到gridProps getGridProps: -> { budgets } = @props.profile rowHeight = headerHeight = 35 extraHeightToPreven

我的屏幕越小,没有值的列就越多。只要我手动调整屏幕的宽度(通过将其拉大或拉小),所有的值都会显示出来。这好像是一个错误。我附上了两张照片,显示了html如何在相邻单元格中显示,有值和无值显示

|


我们找到的解决方案是将minColumnWidth:10添加到gridProps

getGridProps: ->
    { budgets } = @props.profile
    rowHeight = headerHeight = 35
    extraHeightToPreventScrollBar = 10
    rowsCount = budgets?.length ? 0

    columns: @getColumns()
    rowGetter: (i) =>
        budgetRows = @getBudgetRows()
        budgetRows[i]
    rowsCount: rowsCount
    minHeight: rowsCount * rowHeight + headerHeight + extraHeightToPreventScrollBar
    enableCellSelect: not @state.tableDisabled
    onGridRowsUpdated: @handleGridRowsUpdated


getColumns: ->
    cols = [{ key: 'year', name: 'Year', editable: false, width: 70 }]
    for month in MONTHS
        cols.push
            key: month
            name: month
            editable: not @state.tableDisabled
            formatter: FormattedCell
    cols.push
        key: 'total'
        name: 'Total'
        editable: false
        formatter: FormattedCell
    cols.push
        key: 'trash'
        name: ''
        editable: false
        formatter: getTrashCan @removeBudget, @state.tableDisabled
        width: 50

    cols

getBudgetRows: ->
    { budgets } = @props.profile
    _.map budgets, (monthlyBudgets) ->
        row = { year: monthlyBudgets.year }
        for month, monthIdx in MONTHS
            row[month] = monthlyBudgets.budgets[monthIdx] ? '' # ReactDataGrid cannot take null, convert to ''
        row.total = Util.getBudgetsTotal monthlyBudgets ? ''
        row.trash = monthlyBudgets.year
        row