React-data-grid: Wrapping cell and responsive

Created on 27 Nov 2016  路  6Comments  路  Source: adazzle/react-data-grid

Is there any possibility to wrap text in cells? How to make a large table she would appear on the tablet, phone? Below please find a template:
image

Most helpful comment

@diogofcunha : I'm not able to find any of the doc talks about text wrapping. Could you please help us to find the doc for text wrapping?

All 6 comments

Please read the docs before asking,
Check the basic example

What was the answer for how to wrap text in cells?

@diogofcunha : I'm not able to find any of the doc talks about text wrapping. Could you please help us to find the doc for text wrapping?

In the basic example width is not specified (see 'Jump to source code' on the example page - http://adazzle.github.io/react-data-grid/scripts/example01-basic.js). If you don't specify the width, it will automatically resize columns.

But I don't believe text wrapping happens. So not sure why this is closed.

Apparently text wrapping is not a feature.

use formatter
for example :

columns : [
                {
                    key: 'text',
                    name: 'Text',
                    formatter : WrapperFormatter
                },

            ];
import React from 'react'


export default class WrapperFormatter extends React.Component {
    static propTypes = {
        value: React.PropTypes.number.isRequired
    };
    static defaultProps = {
        value : 0
    }
    /**
     *
     * @returns {*}
     */
    render() {
        return (<p style={{whiteSpace:'pre-wrap'}}>{this.props.value}</p>)
    }
}

Was this page helpful?
0 / 5 - 0 ratings

Related issues

localhosted picture localhosted  路  4Comments

gauravagam picture gauravagam  路  3Comments

markmus picture markmus  路  4Comments

daniel1943 picture daniel1943  路  3Comments

ganapativs picture ganapativs  路  4Comments