on 09-07-2009 12:21 PM
Hello,
I have a table that is linked to a datasource. The table's columns resize to fit the retrieved values.
I want to determine what the columns' sizes (getWidht) are after retrieval and use these values to change a second table's columns to be the same sizes (setWidth).
Can someone please show me the code how to do this?
I got this to work. The Table and Column Sizes do not display as it's empty unless you specify it.
IWDView view = (IWDView)wdControllerAPI;
IWDTable itemTable = (IWDTable)view.getElement("EmpTable");
IWDTableColumn column = (IWDTableColumn) itemTable.getView().getElement(itemTable.getGroupedColumn(1).getId());
String result = "Table Size: " + itemTable.getWidth();
result += " Grouped Cols: " + itemTable.numberOfGroupedColumns();
result += " Row Count: " + itemTable.getVisibleRowCount();
result += " Grouped Cols Length: " + itemTable.getGroupedColumns().length;
result += " Grouped Cols ID: " + itemTable.getGroupedColumn(1).getId();
result += "Column Size: " + column.getWidth();
//depreciated result += "Column Size: " + itemTable.getColumn(0).getWidth();
wdContext.currentContextElement().setTCellSize(result);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Yes it is not possible to get the width of the table if we dont specify in that field.
Can you try by getting the length of the larger text in that column while populating data into second table.
Using the length of larger text then fix the width of second table.
Or
Specify the width to each and every column in both the table and change the textView wrap property of all the columns to true. So that the size of the columns will be fixed and user can read all the text.
Regards,
Charan
Hi,
Put your code in the wdDoModifyView method. This way, the width of the 2nd table will be changed when the width of the 1st table changes.
Regards,
Pierre
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.