Sencha Touch: How to determine an input is the last in a FieldSet - sencha-touch

So, if you add a bunch of inputs to a FieldSet, the last one has round corners on the bottom. In my form, tho, I hide and show inputs inside the form, depending on a Checkbox at the top of the form.
So now, it is possible that an input, tho logically not the last one in the Fieldset, to be visually, and temporarily, the last one.
Does anybody know how Sencha determines which is the last input in the Fieldset? Just looks which one is the last in the array of inputs, or there is a property I can set to an input to tell it that it is the last one now ... ?

There is a CSS rule, .x-form-fieldset .x-field:last-child, which styles the last child of a fieldset to have rounded bottom corners. There is a bit more to the rule to handle edge cases, but any fields that are added (or hidden/shown) to that fieldset will have the appropriate styling applied just based on their HTML position alone.
The appropriate rule is in \resources\themes\stylesheets\sencha-touch\default\widgets\_form.scss:294 in release 1.1.0.

Thanks to mistagrooves post from above, I've managed to fix the problem. The idea is that I programmaticlly set a class "last" to the input I want it t be rendered as last, and then in my CSS, I rewrite the rules for that .last class like so:
.last, .last .x-form-field-container, .last .x-form-field-container *
{
-webkit-border-bottom-right-radius: .4em;
border-bottom-right-radius: .4em;
border-bottom: none;
}
.last, .last .x-form-label, .last .x-form-label *
{
-webkit-border-bottom-left-radius: .4em;
border-bottom-left-radius: .4em;
}
Hope it helps

Related

Why do my bootstrap-vue b-table column headers not center in deployment?

I have a b-table with centered column headers. The headers are centered when I run locally at http://localhost..., but not in deployment. Why might this be?
I have tried two approaches to centering the headers.
I have added the text-center prop to the b-table component like this...
<b-table
striped
hover
show-empty
sort-icon-left
:items="items"
:fields="fields"
class="text-center"
>
</b-table>
I have included this style rule in my custom scss file, which I import into the app at App.vue
table {
text-align: center;
}
Both approaches work just fine locally, but when I deploy the column headers are aligned right.
Here is a sceenshot from my elements tab in the browser inspection tool.
And the styles tab makes it clear that a text-align: right rule in the tag selector overrides the text-align:center rule in the tag selector.
text-align is an inherited property.
Which means that, when resolving this property for an element, the browser looks for any rules targeting that element first. The element in question is a <th>.
If the browser finds any such rules, it applies the one with the highest selector specificity or the last one from rules with equal specificity.
If no such rules exist, then it inherits the value from the closest parent which has a text-align specified value.
If no ancestor has a text-align value, it defaults to start, which means left for documents with direction="ltr" and right for documents with direction="rtl".
So, basically, the CSS applied to one of the ancestors by Bootstrap:
.text-center {
text-align: center !important;
}
...gets overridden by the following rule applied on the actual element:
th { text-align: right }
regardless of the specificity of the parent rule (because it doesn't target the element directly).
To override the th rule you could use:
table.text-center * {
text-align: center
}
... because table.text-center * has a higher specificity than th and they both target the element (the <th>).
Obviously, if you only want to apply the centering to <th> elements, you should replace * with th in the above selector.
To answer your question on why would it work on local and not on remote: your remote has additional CSS (in app.ee70fc50.css), which resolves text-align value for <th> elements, therefore the parent value is ignored (while on local the parent value is inherited, because you don't apply CSS to <th>s).

Remove safari contacts dropdown from inputs

When typing in input fields safari is creating a dropdown based contacts. I can't figure out how to hide this dropdown. I am able to hide the contacts button.
I'm running Safari Version 11.0.1
Fiddle to reproduce:
https://jsfiddle.net/27n5jL40/1/
<input type="text" name="fname"><br>
Hiding the auto-fill-button
input::-webkit-contacts-auto-fill-button {
visibility: hidden;
display: none !important;
pointer-events: none;
position: absolute;
right: 0;
}
Well, I realize this answer probably comes a bit late, BUT I think I can help. I have found empirically that Safari get its hints from a) the name of the field, b) the associated label, or c) adjacent text. It figures out things like field names "name", "firstname", "lastname", and labels or adjacent text like "name", "First name", "Last name".
In my application, it was competing with a custom autofill. I defeated my dropdown as follows:
I changed my field name from xx_firstname to mxyzptlk, and the label from First Name to F‌irst N‌ame. The ‌ character is a zero width non-joiner. You can't see it on the screen, but it appears to defeat Safari - at least for now!
Wish I'd found some clever css, but this was the best I could come up with.

How to style cells within columns of dataTables?

I have made a table (with child rows) using jQuery plug in dataTables. I'm having trouble finding out how to apply a style to an individual column of cells (<td>)
I've made an edit to this existing fiddle as you can see I've made the text larger in column 2, but I also want to make the text larger (plus other styling) in column 4 and 5.
I put a class in line 114 in the CSS (this is the original css from dataTables) and this made the text bigger,
.sorting_1{
font-size: 29px;
line-height: 29px;
}
it didn't work for the other columns (as I assumed .sorting_2, .sorting_3 (etc) was the class to change it). When looking at the inspect panel you can see the <td> tag for the the changed cells all have the class of sorting_1, but the others don't and I'm not sure how to do that,
How would I do this?
Each row has the class of either even or odd so you could use nth-of-type to specify the td that you want to style and go from there. You would have to style both the even and odd column so you would have to specify both like so:
.even td:nth-of-type(4),
.odd td:nth-of-type(4){
background:red;
}
.even td:nth-of-type(5),
.odd td:nth-of-type(5){
font-size:20px;
}
Or you could specify it by the role attribute and use nth-of-type like so:
tr[role=row] td:nth-of-type(4){
background:red;
}
tr[role=row] td:nth-of-type(5){
font-size:20px;
}

How to center the "featured products" (prestashop)?

I have a big problem with arranging the text from "featured products" in prestashop. First of all, I want the title to be on two lines and centered. I've tried several methods, but with no success. Second, I want "short description" to have more characters and be centered as well.
I've posted below the link to the site and an image of how I would like it to look. Do you know what line should I change or what I need to do?
http://www.3bwine.com/CRISTY/prestashop/index.php
http://oi58.tinypic.com/1608m10.jpg
This is a simple CSS "problem". Css for described changes come from two files.
.../prestashop/themes/default/css/golbal.css
.../prestashop/modules/homefeatured/homefeatured.css - this is not very important but may or may not interfear with some of our changes
To align your title they way you showed on your image I reccomend to add these lines of code to your global.css file ( as you dont have any VERY unique classes on your p or a elements we will be targeting them from a bit further)
div#featured-products_block_center div.block_content ul li p.s_title_block a{
text-align:right;
width: 150px; // set as big/small as you want yoru heading title to display, you can play around with it. This should push the title on two lines, but if your title is chagining all the time in lenght then it might not be useful.
font-size: 22px; // should overwrite the current font-size, make as big/small as you need
}
To align description the way you need add this line to global.css file
div#featured-products_block_center div.block_content ul li div.product_desc a{
text-align:right;
margin-bottom: 20px; // you can play around with it , this pushes your price further away from the text
}
To change the lenght of your short description go to ../prestashop/modules/homefeatured/homefeatured.tpl and locate something similar to this
{$product.description_short|strip_tags|truncate:65:'...'}
And there change the truncate to whatever you need. ( changes the lenght of your " short description"). Number is in characters.
BR's

DIV stylesheet attributes?

I am new to div stylesheet and i only discovered how to use :
margin-top/left/right/bottom.
What is the position used for ?
What is left/right/top/bottom attrib used for?
What is display used for?
Is there any other attrib which i need to take note of/usage for positioning my div ?
Regards
http://www.w3schools.com/css/pr_class_position.asp
http://www.w3schools.com/css/pr_pos_left.asp
http://www.w3schools.com/css/pr_class_display.asp
http://www.w3schools.com/css/css_positioning.asp
margin is in relation to the closest container while left/right... is in relation to the entire page.
Display determines if the object is visible/hidden or how the element behaves. Like display: inline means the elements will display on the same horizontal plane if possible.