ExtJS 5: How do I include text after a numberfield? - extjs

Just about every field has a fieldLabel and a boxLabel config to set text either before or after the field. However, number field just happens to be one of them that does not. Is there anyway I can set text after a number field?
Example:
[ 1 ^] text goes here

Looks like this did the trick
afterSubTpl: 'this is after'
However it appears below the numberfield instead of directly to the right.
And this
beforeSubTpl: 'this is before'
puts the text above it, instead of to the left.
Working seeing if this can be fixed with styling.

Related

How to Print the Disabled text from Geb/Groovy?

enter image description here
We are automating the UI Application, Our UI application have Disabled Text are present, so we need to Validate the Disabled text. Before validating, I have to Print the Disabled text, Please guide me to how to print the text using Geb/Groovy.
Please find the Image of HTML tag which i highlighted is the Disabled text
BNSF0000712570
BNSF0000712570
The selector above will yield multiple results, i.e. elements, if there is more than one element that matches the classes used in the By.cssSelector query.
To get only the element containing "BNSF0000712570", I would suggest you try to get it using the "ext:qtip" attribute instead (which I assume is unique per element containing a disabled text) on the div containing the disabled text:
def myText = $(“div[ext:qtip=‘Id: 0001’]”).text();
println myText;
assert myText == "BNSF0000712570";
#Saurabh Gar: Why would you use the WebDriver "By" class selectors? With Geb you have access to a wide range of simpler ways to write selectors, e.g. like the one used above.
You should try using By.cssSelector as below :-
def text = driver.findElement(By.cssSelector("td.x-grid3-td-elementvalue").text
Or
def text = driver.findElement(By.cssSelector("div.x-grid3-col-elementvalue").text
assert text == "BNSF0000712570"
println text
Note:- If still doesn't get the text need to share table HTML insteadof screenshot that's why, could make a best locator.
Hope it helps..:)

ExtJS 6 - Tag field auto width

I am dealing with ExtJS 6 Tag field and I would like to set an auto-width in the suggested tags, because if the tag names are too short there will be a huge blank space in the field.
As far as I know it is supossed to work by using this two properties (but it does not work for me):
matchFieldWidth: false
shrinkWrap: true
The current behaviour is that the width is reduced and it breaks the lines, if the tag name is "This is a tag" it is shown in two different lines "This is" "a tag". Any ideas to achieve this goal?

How to restrict Number Field default value set to '0' in extjs

I am using Extjs 3.4, I have a grid where I use editor function and form of NumberField type.
Here is my scenario, when the user starts editing a number field and immediately clears it and navigating to next page makes the field value set to '0' with dirty flag set which i dont want.
So, please help me out in having the control over the cell edited and also get the value i updated in the cells.
Thanks in advance,
RK
In ExtJs, when we defined a int field in the model.Its default value is taken as 0.We need to take help of useNull property in field with value as true:
{
name: <fieldName>,
type: 'int',
useNull: true
},

Select Field display in weird ways

Here is a TAG
The white block is the select field
Here is the select field selected
Here is the code
Why is it expanding out of it's limit ? there is nothing fancy there?
I think the problem is with your layout type.Which layout you are working with?Try it after removing layout config and add
xtype:'textfield',
anchor:50%,
itemId:'field'
If you are to use
selectfield.setHtml() and set it to a String.
It will destroy display and display the String ahs the value.
It's better to use setText() to do so.

How to set width and height of text field in cakephp?

In my application, I need to take input from the user for a column named 'body' in a table in the database.
My code in the .ctp file is:
echo $form->input('body',array('style'=>'width: 900px'));
In this way, i am able to specify the width of the body field which works fine. But, I want to specify the height as well.
I tried echo $form->input('body',array('style'=>'width: 900px height: 500px'));
echo $form->input('body',array('style'=>'width: 900px','style'=>'height: 500px'));
The first one doesnt work for either width or height and the second one modifies only the height but not the width.
Can someone please tell me how to overcome this issue.
Thank you very much in advance.
// in a css file.
.txtArea { width:900px; height:500px; }
// in your view
echo $form->input('body', array('class'=>'txtArea'));
would be the recommended and preferred manner.
Alternatively, make sure your inline CSS is correct:
echo $form->input('body', array('style'=>'width:900px; height:500px;'));
Your code appears to be missing a ;, and of course by specifying style twice you will be overwriting the previous value.

Resources