ListGrid listGrid = new ListGrid();
listGrid.setWidth100();
listGrid.setFields(f1, f2);
vlayout.addMember(listGrid);
listGrid.setAutoFitFieldsFillViewport(false);
listGrid.setAutoFitFieldWidths(false);
listGrid.setCanAutoFitFields(false);
ListGridField[] listGridFields = listGrid.getFields();
for (ListGridField listGridField : listGridFields) {
listGridField.setAutoFitWidth(true);
}
I’ve got this lines but when I resize the window in which I put listGrid, the fields do not resize and fit the new width.
Could someone help me to make the width of the fields of this listGrid fit the window ?
Then if I put this :
ListGridField[] listGridFields = listGrid.getFields();
for (ListGridField listGridField : listGridFields) {
listGridField.setWidth("100%");
}
It resolve the problem when I resize the window on first time. But resizing a field make a gap on the right between the last field and border of the listGrid.
Is there a way to solve this ?
Summary :
Is there a way to make the listGrid atomatically resize with resizing of the window ?
Is there a way to make the fields of the listGrid always fit the size of listGrid which always fit the width of its parent ?
Is that possible to have this result : http://jsfiddle.net/lnplnp/kJLGd/
Finally I’ve tried
listGridField.setWidth("100%");So the answer is :
Assigned a fix width to at least one field, respond to my expectation.
It work in most of case but sometime this method does not work correctly. I cannot describe the exact situation. I will edit this response if I found what make it does not work.