Losing focus on text field - extjs

Am using extjs 3.0
I have a scenario like
on entering any data on text field and hit enter i have to show a grid based on the value of text field, user keeps on entering the data in text field. but once the grid is created am reloading the store based on the value of text field by setting the value to store as base param.
on the first time of displaying grid focus is loosing from text field,once the grid is visible the cursor is focusing on the text field.
Am using focus method on text field but its not working...
Help me thanks in advance

You can defer the focus with:
field.focus(500) //This is 500 milliseconds

Related

Semantic react UI, changed height of input field, now text begins in the middle?

I'm using react semantic ui and have an input field, I changed the height of this input field, but my text cursor now begins in the middle of the field. How do I change it back to the top?
Like this
This is the code
Thanks for your assistance

How to 'preselect' text in a TextField so that typing something new immediately replaces the previous text?

It is common practice in many UI situations to preselect the text displayed in a text editing field in such a way that if the user starts typing it immediately replaces the displayed text.
This can be useful for example in search field to show the previously searched text (for reuse or editing) while making it easy to search for a new text string simply by start typing.
I've searched for how to do this in TextField, but not found a way yet - is it possible?
We don't have a concept of pre-select and it isn't common in mobile where selection is awkward by comparison. A more common approach here is to have an X button next to the text field which clears the text field instantly. You can easily do it by just adding a button next to the field.

how to access the value of input text was nested in ui-grid cell

enter image description here
I made a cell template(ui-grid) which contains a label, a textfield, and a button. I bind a ng-click on the button. But I dont know how to access the value of textfield. Because what I want to implement is when user input value in the field and click save imagebutton and it will call ajax then do some update in web service.
I was wondering that is it possible to access the textfield from row entity, but I could not find the textfield property in the grid-cell.
thank you so much
ui-grid has built in row editor features. Try the link below.
http://brianhann.com/create-a-modal-row-editor-for-ui-grid-in-minutes/

Is it possible to disable the abiity to horizontally scroll inside a Codename One text field

Is it possible to disable the user to scroll inside a text field when it is focused? I have tried:
pinT = new TextField();
pinT.setSingleLineTextArea(true);
pinT.setScrollSize(new Dimension(0,0));
You shouldn't use any of the above. Since the scrolling is native it can't be disabled but you can limit the number of characters that the user can type into the text field using:
pint.setMaxSize(charCount);

Change view of form on click of button or checkbox

I have to make a form codename-one in which i have a check box. if check box is checked then bellow it i want to display 2 combo box and if check box is unchecked then i want to display 2 text field.
How can i do it.
I have tried setVisible(true/false) but in it space consumed by label or text field is never covered up.
Please help.
You need to remove/add the components and then invoke either revalidate() or animateLayout(int) to refresh the UI.

Resources