1

i am developing a data table using flextable i want to set the width, i did for each cell it is working fine. Due to preformance concerns i want to move the from cell level to column level, so i used ColumnFormatter but it throwing the

com.google.gwt.core.client.JavaScriptException: (Error): Invalid argument

ft.getColumnFormatter().setWidth(col, widths[col] + "px");

any guess what is going wrong?

i set table-layout:fixed and border-collapsed for table.

JAVAC
  • 1,230
  • 3
  • 17
  • 38
  • http://stackoverflow.com/questions/5035509/gwt-application-throws-javascriptexception-in-ie-only-stack-trace-has-no-help might be of interest. – dting May 17 '12 at 10:56
  • The issue is with a column i have to set width to 0 pixels, where GWT is unable to set 0 value as width and throwing the Javascript exception. For me work around is i set width to table and remaining all columns i set values which sum equal to table width it works, which column i dont want width i skipped setting width so it auto 0 pixels Thanks Mike Myers for your valuable time – JAVAC May 17 '12 at 13:13

2 Answers2

0
Invalid argument   

Let's see which argument is it:

ft.getColumnFormatter().setWidth(col, widths[col] + "px");

Here, one of the arguments is null.
Most probably col.

Check the flow by debugging in eclipse.

GingerHead
  • 8,130
  • 15
  • 59
  • 93
0

I had the same problem and found out that setting the width to zero is the problem. Changing it to ...

if (widths[col] > 0) {    
   ft.getColumnFormatter().setWidth(col, widths[col] + "px");
}

solved the problem.

Please note that this only happens when using IE11!

Norbert
  • 1
  • 2