I need to display complete column header name, when column is selected, it means increase column width. And reset width when column is deselected. I did not find example in nattable_examples.exe. Is there some built in feature?
No there is no built-in feature that would support automatic increase/decrease of column widths on selection. You will need to implement some selection listener and then do an auto-resize on the selected column by using the AutoResizeColumnsCommand.
But I don't think we have an event on deselect, so I am not sure how you want to reduce the column width again.
Related
When we have 200 Columns in an Ag-grid and the user wants to look for a particular column, normally it is done by scrolling and looking for that column but having 200+ columns is going to be annoying.
So we need to develop and search box to search for the column name we scroll and set focus on the given column.
What I have tried
The following code does focus but only on visible columns, if I have to focus on the 100th Column it doesn't work
gridRef.current.api.setFocusedCell(0,gridRef.current.columnApi.columnModel.getAllDisplayedColumns()[10]);
You can use the below method ensureColumnVisibleto make sure the column is visible.
const allColumns = params.columnApi.getAllColumns();
console.log(allColumns);
params.api.ensureColumnVisible(allColumns[allColumns.length - 1].colId); // <- changed here
forked stackblitz
I have custom word add-in, which inserts content control with numbers and currency symbols as text into word document at the cursor position.
Requirement is if content control is getting added inside a table, as a table cell, then width of content control should match with table column width.
Current behavior:
current behavior
Expected behavior:
expected behavior
Questions:
Is there any office JS API or out of the box Word feature to auto adjust content control width to match with table column width?
If not, is there any way to calculate width of both content control and table column programmatically and get number of spaces to be added? This algorithm should be generic so that it would work for all font families and font sizes.
Thanks for reporting the issue. It's definitely not right behavior and it has been put on our backlog 6336725. We will let you know when there is update. Thanks!
Im going to create an excel like application in Flutter where the user can input a quantity to one of the cells and the app automatically calculate its values based on quantity.
Shall i use DataTables or Tables widget?
Both accept widgets as cell content like TextField, Slider or just Text. Anywhere there are some differences:
Feature
Table
DataTable
Checkbox column
no
showCheckBoxColumn
Set column width
columnWidth
no
Set row height
no
dataRowHeight
Sortable
no
integrated
If a cell with a no this does not mean, its not possible. The feature is just
not directly supported by the widget. In all cases sizes will computed according to Flutters rendering engine: constraints go down, sizes go up.
Anybody please feel free to add more content to above comparison.
How to save Column order and width after changing their position and size ?
re-sized column width should be persisted and used in the subsequent sessions (and also considered during export/import preferences usecase)
any change in the column position should be persisted and used in the
subsequent sessions (and also considered during export/import
preferences usecase)
Q1. How can I get the column width of the nattable after changing the width by dragging/double click event ?
- I want this with original column position even after the column is not in the original order.
Q2. How can I get the column order, after re-order using drag and drop?
Answer to Q1:
Ask the layers, they have getWidth() and getColumnWidthByPosition(int) methods
Answer to Q2:
Typically you will need to check the ColumnReorderLayer directly.
But if you want to store and load NatTable states, you should have a look at the persistence mechanism provided by NatTable. I wrote an article about this and it is even documented on the NatTable website.
Is it possible to measure the height of a table row in LibreOffice writer? I want to be able to measure the actual height of a table row in the document. I create the document by copying a template file and modifying the document.xml.
Use Case: Need fixed height for the table. If the table height is smaller than the required height, add an empty row to make up for the height.
What have you tried?
LibreOffice API doesn't provide a direct call to get the height of a TextTable.
See this thread to get an idea of how you can compute a height value.