View Full Version : Trigger Grid AutoFill on reload

16 Feb 2012, 8:21 AM
Currently I have a grid (columns are resizable) that is being used to store some addresses and the user has to go to another view to edit this information, so I hide the grid and show the other view.

When they save the new address information and I show the grid again I am using reconfigure to update the information so I don't have to remove the grid and rebuild it completely. My problem is that my grid width is dynamic so I am using grid.getView().setAutoFill(true); when creating the grid, but this doesn't get triggered on reconfigure so all of the columns go back to my default width, which I don't want.

Is there a way to make the Auto Fill be triggered on reconfigure?

public void createGrid(ListStore<SubmissionIndividualVO> store) {
createColumnModel(); // Create a new columnModel every time so the old one isn't used
if(grid == null){ // Only create the grid once
grid = new Grid<SubmissionIndividualVO>(store, columnModel);
grid.reconfigure(store, columnModel);

17 Feb 2012, 6:38 AM
Hi Joshua

The problem you are facing is not clear. If you provide a simple and complete prototype, it will be helpful for others to try it out and help you


22 Feb 2012, 8:16 AM
I have not had time to modify my code to make it have an entry point yet (we just rolled our product into production, so it's hectic around here) so here is a concise explanation of the problem.

I have a grid in a view that can be resized. In the column model I set the width of the columns so I can fall back on these if I need. When I load the grid I call the setAutoFill method, which by definition says

"True to auto expand the columns to fit the grid when the grid is created."

When I call reconfigure on my grid it then goes back to the default width because auto fill only executes when the grid is created, and reconfigure doesn't recreate the grid.

Is there an easy to implement way of making the grid's columns auto fill if the grid has already been created?