How to use EXT-GWT ComboBox

How to use ComboBox in EXT-GWT with static data. For example, I just want to use a hard code (for demo purposes) a list of first names and display it to the user. I do not want to use any dummy objects that they use in their samples. Where can I find a simple string example?

+2
source share
2 answers

Here is the code that I use in my project:

SimpleComboBox combo = new SimpleComboBox();
combo.add("One");
combo.add("Two");
combo.add("Three");
combo.setSimpleValue("Two");
+2
source

Maxim,

I'm not sure if this helps you or not. It was based on the GWT-EXT for combobox. As I recall, it wraps String [] using a SimpleStore object.

//create a Store using local array data  
 final Store store = new SimpleStore(new String[]{"abbr", "state", "nick"}, getStates());  
 store.load();  

 final ComboBox cb = new ComboBox();  
 cb.setForceSelection(true);  
 cb.setMinChars(1);  
 cb.setFieldLabel("State");  
 cb.setStore(store);  
 cb.setDisplayField("state");  
 cb.setMode(ComboBox.LOCAL);  
 cb.setTriggerAction(ComboBox.ALL);  
 cb.setEmptyText("Enter state");  
 cb.setLoadingText("Searching...");  
 cb.setTypeAhead(true);  
 cb.setSelectOnFocus(true);  
 cb.setWidth(200);  

, . Tiger

ps) ?

    // create store 
ListStore<String> store = new ListStore<String>(); 
store.add( Arrays.asList( new String[]{"A","B","C"})); 
ComboBox cb = new ComboBox(); 
cb.setStore(store);
+1

All Articles