Sencha Touch how to set selected item in selectfield - extjs

I'm using Sencha Touch 2.3.1.
How to set an select item in a selectfield ? It's seem no method to support this. I don't want do the trick set an Placeholder to the selectfield.
I have tried to Google it. But it's seem nobody talk about this.

Obviously it supports.
The value of the Ext.field.Select itself is the value of the selected item. So, you can either set the initial value or dynamically change it at anytime with the value config, via setValue method.

Related

sencha modern list item swipe item bug

I'm trying to provide swipe actions in Sencha Modern list in version 7.2.0.
Although the documentation indicates that the text, ui, iconcls and cls are bindable, I'm unable to get it to work.
Further, the text seems to be getting bound without any bind configuration which is even more surprising.
Please see relevant fiddle
Essentially, I would like to make the iconCls and the cls change based on the record's data.
Thanks
There is definitely an issue here. The text does not seem to be handled as a bind. If the text field exists it is used..... so I did a quick override that treats the ui field similarly. if it exists it is using it. You can do the same with the iconCls... etc.
Swipper override fiddle

Set defaultSelectedKeys with a button click in antd Tree to change Selected Node

I would like to change the selected node in antd Tree by using defaultSelectedKeys property, doesn't work. I also tried changing other property like showLine which seem to work but not defaultSelectedKeys.
Here is the link to code: link
Also, suggest if a better way to achieve the same.
TIA
defaultSelectedKeys used only on mount, therefore changing the state without unmounting the component will not affect the defaultSelectedKeys.
If you want to control the select values, use selectedKeys:
selectedKeys (Controlled) Specifies the keys of the selected treeNodes | string[]

Codename One ComboBox how to highlighting already selected value

We are able to create ComboBox and populating data too. But we need to highlighting already saved values. Can you please suggest code for this.
Our requirement is if Combobox has 1,2,3. If I select 2 and save. We need to set the combo box value 2 in such way that when we open the Combobox need to display this 2 as highlight value along with 1,2,3 values.
Simply same as select box option selection.
I would generally recommend avoiding ComboBox altogether.
Assuming this isn't an option you will need to define a renderer and disable the OS specific 2 render mode using a theme constant:
otherPopupRendererBool=false

Default value for ExtJs Combo box without using emptyText

I'm using ExtJs 4 and in my Web application I have a combo box. Previously I used to set the default value of the combo box using emptyText. It works just fine. But, is there any alternative way of setting the default value for the same?
I looked into different questions here on SO and tried the following -
Ext.getCmp('myComboBoxID').setValue("myValue");
However, this doesn't seem to be working. I also tried the simple value attribute to no avail. How can I the set the default value other than using emptyText?
Also, when the value is set using emptyText, it is displayed in gray color (which is poorly vsible), I was wondering if one can work with the opacity of the ExtJs select box?
Update: I used Ext.getCmp('myComboBoxID').setRawValue("myValue"); to set the value & it worked. What is the difference between setValue() & setRawValue()?
You need to supply the id to getCmp method. Try the following.
Ext.getCmp('#myComboBoxID').setValue("myValue");
I used Ext.getCmp('myComboBoxID').setRawValue("myValue"); to set the value & it worked.
The store needs to be loaded before you call setValue and you use the id of the record you want to select. There is a load event you can listen for if the values are loaded from the server. emptyText is not intended for default values, but to help the user understand what should be done with the field (eg "Select a state" from a list of states)

How i can turn off autocompletion in Extjs combobox?

When I selected some item in combobox and then I'm trying to select another item in same combobox, I can see only one item - those which is selected right now. I believe that happens because of autocompletion. Does anybody know how I can disable it or something. I need to see all values on each click, regardless if something was selected already or not.
Add triggerAction:'all' to your config.
better add disableKeyFilter:'true' to your combo box

Resources