Required Information

Version(s) of Ext GWT
GXT 3.0.1 GPL

Browser versions and OS
(and desktop environment, if applicable)
NA

Virtual Machine
NO

Description
In GXT 2.x there was the ability to set what the initial sort state of the store for a grid was to match the presorting of the list. For example, if the list was pre-sorted by name asc you could tell the store that was the case so you would not have to initailly click on the column header twice to get a sort desc since the first click would trigger a sort asc which the list was already sorted as such.

Run mode
Both

Steps to reproduce the problem
  1. Create a liststore with models that have a name string field
  2. Sort the liststore by the name field asc
  3. add the store to a grid with a name column
  4. click on the name column header - nothing happens
  5. click on the name column header again - the list is now sorted desc

Expected result
The first click would result in the correct sort of being opposite of the current sort sate i.e. if sorted asc would be desc now.

Actual result
Must click twice on column header instead of once.

Test case
import java.util.ArrayList;
import java.util.List;

import org.swis.noah.client.Person.PersonProperties;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.editor.client.Editor.Path;
import com.google.gwt.user.client.ui.RootPanel;
import com.sencha.gxt.core.client.ValueProvider;
import com.sencha.gxt.data.shared.ListStore;
import com.sencha.gxt.data.shared.ModelKeyProvider;
import com.sencha.gxt.data.shared.PropertyAccess;
import com.sencha.gxt.widget.core.client.container.Viewport;
import com.sencha.gxt.widget.core.client.grid.ColumnConfig;
import com.sencha.gxt.widget.core.client.grid.ColumnModel;
import com.sencha.gxt.widget.core.client.grid.Grid;


/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class GXTSandBox implements EntryPoint
{
/**
* This is the entry point method.
*/
public void onModuleLoad ()
{
ListStore<Person> store = new ListStore<Person>(PersonProperties.INSTANCE.key());


store.add(new Person("Abby"));
store.add(new Person("Bart"));
store.add(new Person("Clyde"));

ColumnConfig<Person, String> nameColumn = new ColumnConfig<Person, String>(PersonProperties.INSTANCE.name());
nameColumn.setHeader("Name");

List<ColumnConfig<Person, ?>> columns = new ArrayList<ColumnConfig<Person, ?>>();
columns.add(nameColumn);

Grid<Person> grid = new Grid<Person>(store, new ColumnModel<Person>(columns));

Viewport viewport = new Viewport();
viewport.add(grid);

RootPanel.get().add(viewport);


}
}


/**
*
*/
class Person
{
/**
*/
public interface PersonProperties extends PropertyAccess<Person>
{
/**
*/
final PersonProperties INSTANCE = GWT.create(PersonProperties.class);


/**
*
* @return ModelKeyProvider<Person>
*/
@Path("name")
ModelKeyProvider<Person> key();

/**
*
* @return ValueProvider<Person, String>
*/
ValueProvider<Person, String> name();
}


/**
*/
private String name;



/**
* Constructor
*
* @param name String
*/
public Person (String name)
{
this.setName(name);
}


/**
*
* @return String
*/
public String getName ()
{
return this.name;
}


/**
*
* @param name String
*/
public void setName (String name)
{
this.name = name;
}
}