reactjsag-gridag-grid-react

Is it possible to break word in space in AG Grid Wrap text


i am using Ag Grid in react web app. The problem is that i need to display very long texts. When i used wrapText={true} and autoHeight={true} properties everything devides in to lines like it supposed to. Although most of the time text line break happens on the some word, even though there are plenty of space to break word on spaces.

<AgGridColumn
   headerName={'content'}
   editable={true}
   field="content"
   flex={1}
   wrapText={true}
   autoHeight={true} />

I was wondering is there are some ways to make line brake on spaces?


Solution

  • columnDefs = [ { field: 'fieldName', wrapText: true, autoHeight: true, cellRender: (params) => { return ( <div style={{ wordBreak: "break-word" }}> { params.value } ) } } ]