Posted 6 August 2019, 5:09 am EST
I have a multi-line cell that contains comments in my FlexSheet . Is there any way to allow the user to space the data in that cell as they please. For example, using Alt + Enter to add a new line.
Forums Home / Wijmo / General Discussion
Posted by: brandon.grime on 6 August 2019, 5:09 am EST
Posted 6 August 2019, 5:09 am EST
I have a multi-line cell that contains comments in my FlexSheet . Is there any way to allow the user to space the data in that cell as they please. For example, using Alt + Enter to add a new line.
Posted 6 August 2019, 3:21 pm EST
Hi Brandon,
If you set the multiLine property of a row or a column to true, you can add the next line in the cell while editing by pressing Alt + Enter by default. Could you please tell us more about your requirement so we can assist you further?
Regards,
Ashwin
Posted 7 August 2019, 1:01 am EST
its weird, in edit cell mode it works and displays the correct line spacing but once I exit the cell the lines disappear.
edit :
test
test
test
view:
testtesttest
Posted 7 August 2019, 3:59 pm EST - Updated 3 October 2022, 10:42 am EST
Hi Brandon,
We are sorry but we were not able to replicate the issue at our end. Please refer to the sample below and the attached screenshot.
https://stackblitz.com/edit/react-hk9feb
Could you please tell us whether we are missing something in order to replicate the issue?
~regards
Posted 7 August 2019, 11:27 pm EST
so I basically trimmed my solution down to bare bones to your example and I still get the same issue, am I missing something (see below):
<FlexSheet
initialized={this.flexSheetInit}
style={{ height: '545px', width: `${this.state.windowWidth}px`}}
class={'paFlexSheet'}
/>
flexSheetInit(flexSheet: wjcGridSheet.FlexSheet): void {
const grid: wjGrid.FlexGrid = new wjGrid.FlexGrid(document.createElement('div'));
grid.initialize({
allowAddNew: false,
allowDelete: false,
autoGenerateColumns: false,
autoSizeMode: wjGrid.AutoSizeMode.Both,
columns: this.getColumns(this.props.projects),
itemsSource: this.props.projects,
selectionMode: wjGrid.SelectionMode.Cell,
});
flexSheet.sheets.push(new wjcGridSheet.Sheet(flexSheet, grid, 'Assessments'));
flexSheet.rows.forEach((row) => {
row.multiLine = true;
row.height = 80;
});
}
getColumns(projects: Array<IProjectAssessmentDTO>): Array<IFlexColumn> {
.......
{ header: `${assessment.MonthName} - Comments`, binding: `Assessments[${assessment.MonthID}].Comments`, name: `Assessments[${assessment.MonthID}].Comments` },
........
this.setState({
columns: columns,
});
return columns;
}
```[img]https://gccontent.blob.core.windows.net/forum-uploads/file-cb7f4198-e1e1-49c2-a7ac-26a59d1b0c9c.gif[/img]
Posted 8 August 2019, 2:56 pm EST
Hi Brandon,
I copied your code to my sample but I am afraid that I was still not able to replicate the issue. Could you please provide a sample replicating the issue?
Also, please let me know which version of Wijmo are you using and please ensure that the ‘paFlexSheet’ class may not be causing the issue.
https://stackblitz.com/edit/react-rc6j6h
~regards
Posted 11 August 2019, 11:31 pm EST
Hey,
the version we are using is Wijmo Library 5.20183.550. I will work on putting together a sample replicating the issue.
Thanks,
Posted 12 August 2019, 4:05 pm EST
Hi Brandon,
I tried to replicate the issue with the version provided but I was not able to replicate it.
Yes, please provide us a sample so we can investigate this and help you to solve the issue.
~regards
Posted 13 August 2019, 12:10 am EST
Odd, it wasn’t getting the wj-multiline class when the cell wasnt being edited. So I just added it in the itemFormatter for that column. Works for me haha.
Posted 13 August 2019, 3:14 pm EST
Hi Brandon,
I am glad that you were able to resolve the issue. Let us know if you face any other issues.
~regards