Listgrid for smartgwt has a function to display the line number. I tried using this for small tables, and it works like a charm.
But for tables with more than 9999 rows, the row number column does not display more than four digits.

So here is the question. How to make Listgrid display all the digits in the row number column?
My test grid:
ListGrid listGrid=new ListGrid();
listGrid.setWidth(300);
listGrid.setHeight(200);
ListGridField name = new ListGridField("name", "Name");
listGrid.setFields(name);
listGrid.setShowRowNumbers(true);
Record[] records=new Record[10000];
for (int i=0; i<records.length; i++){
Map<String, String> map=new HashMap<String, String>();
map.put("name", "Hello");
records[i]=new Record(map);
}
listGrid.setData(records);
listGrid.setAutoFitData(Autofit.HORIZONTAL);
source
share