When applying pre-defined hilites, they do not work immediately. When calling ListGrid.editHilites and then pressing save, they work.
I have this is issue on SC_SNAPSHOT-2011-05-25/PowerEdition Deployment (built 2011-05-25), GWT 2.1.0 and Firefox 4.
I have this is issue on SC_SNAPSHOT-2011-05-25/PowerEdition Deployment (built 2011-05-25), GWT 2.1.0 and Firefox 4.
Code:
import com.google.gwt.core.client.EntryPoint; import com.smartgwt.client.data.Criterion; import com.smartgwt.client.data.DataSource; import com.smartgwt.client.data.Hilite; import com.smartgwt.client.types.OperatorId; import com.smartgwt.client.widgets.IButton; import com.smartgwt.client.widgets.events.ClickEvent; import com.smartgwt.client.widgets.events.ClickHandler; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.layout.VLayout; public class HiliteTest implements EntryPoint { private static final Hilite[] HILITES = new Hilite[]{ new Hilite() {{ setCriteria(new Criterion("cstm_pk", OperatorId.EQUALS, 1)); setBackgroundColor("#FF0000"); setId("0"); }}, }; public void onModuleLoad() { final ListGrid listGrid = new ListGrid(); DataSource ds = DataSource.get("Customer"); ListGridField name = new ListGridField("cstm_name", "name"); ListGridField pk = new ListGridField("cstm_pk", "pk"); listGrid.setFields(pk, name); listGrid.setDataSource(ds); listGrid.setAutoFetchData(true); listGrid.setHilites(HILITES); IButton button = new IButton("edit hilites"); button.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { listGrid.editHilites(); } }); VLayout vLayout = new VLayout(); vLayout.addMember(listGrid); vLayout.addMember(button); vLayout.setHeight100(); vLayout.setWidth100(); vLayout.draw(); } }
Code:
<DataSource serverType="sql" dbName="Mysql" tableName="Customer" ID="Customer" > <fields> <field primaryKey="true" type="sequence" name="cstm_pk" hidden="false"></field> <field type="text" length="45" name="cstm_name" title="" required="true" export="true"></field> </fields> </DataSource>
Comment