Set angular component default values - angular-material

I am using angular material components. In mat-card-actions component I would like to set align=end as a default value, so that I do not need to add it in all my forms.
What is the best way to achieve this? I was thinking about extending the component, but I'm hoping for a simpler solution.

You can make it by simple style in your css. Look :
In your global styles or some else define this styles:
mat-card-actions {
display: flex;
justify-content: flex-end;
}
Example on stack
P.S. It is same as use align="end" but you make it by CSS not by JS

Related

How to use filter after using hide on tr

I currently use tablesorter on a legacy project to add filtering and i'm stuck with a behaviour:
if you manually use $("#tbody>tr").hide(), then $("#tbody>tr.someClass").show(),
Filtering seems not work ( I think tablesorter lost his reference of tr... but i can't find how to told it to update his internal ref).
here an exemple of this behaviour :
https://jsfiddle.net/f2qdz3dp/
When you use a custom theme, you'll need to add this bit of css:
.filtered {
display: none;
}
You can rename the css class by modifying the filter_filteredRow option.
Also, you can set an initial search value by including a data-value attribute on the header cell:
<td class="info" ... data-value="bla">info</td>
This attribute name can also be changed using the filter_defaultAttrib option.

struts 2 jquery grid plugin change only one column header style

Is it possible to change the style of only one column heard in grid ?!
The sjg:gridColumn has a cssClass property, but setting this css will only be applied to rows under the column, not the column header.
At JQGRID - Is it possible to change the background color of HTML header text in JavaScript? I got the code as:
in your HTML page. If you want make the changes for one column only
you can use setLabel method:
$("#myGrid").jqGrid('setLabel','Price', '', {'background':'red'});
or
$("#myGrid").jqGrid('setLabel','Price', '', 'myColorClass');
But I could not make it work.
Finally, as the columns headers will have unique Id, I could use below:
document.getElementById("gridtable_sampleColumn").style.backgroundColor = "#FF0000";
Well do you think there is a better way. I was looking for some thing like this:
<sjg:gridColumn name="sampleColumn"
cssClass="makeThisSmall" />
And in my css
.makeThisSmall{
font-size : smaller;
}
Which did not work and only change the rows css not column header.
Also I find that the gridColumn has a formatoptions could this do what I am looking for ?!
There are no declarative way to set style/class of the column header for specific column (I exclude definition of the CSS rule where the id or the column name are set explicitly). So you should use setLabel to set it.
If you need to change background color then you should take in consideration that background-image have to be set to none too. Additionally you should don't forget that other CSS rules will be applied too and the rule with more specific CSS selector will win. For example the font-size in the column header will be applied because of the following rule from ui.jqgrid.css:
.ui-jqgrid .ui-jqgrid-view {
font-size: 11px
}
which have two classes in the rule. If you want to change the value for columns having makeThisSmall class then you should define CSS rule like
.ui-jqgrid .ui-jqgrid-view .makeThisSmall {
font-size: 8px
}
or
.ui-jqgrid-view .makeThisSmall {
font-size: 8px
}
In any way it should be at least so complex or more complex as the CSS rule which you want to overwrite.
In the same way the background will be applied because of CSS rule which contains two classes too
.ui-widget-content .ui-state-default {
background: ...
}
So you need define the corresponding deep (or deeper) CSS role too to be able to ovewrite it via class attribute.

ValidationMessageFor customValidatioMessage parameter, Message is always displayed, unobtrusive

Im trying to us the
Html.ValidationMessageFor(m=>m.MyProperty,"The field is very much required");
However.. Im alos using unobtrusive for my validations, but for some reason it seems like once Im using the customValidationMessage parameter, the unobtrusive validation for that property "breaks".
Or to put it in more simple terms... the validation message is always displayed, no matter if I enter a value or not.. it simply doesnt update/toggle.
The property is also used on a RadioButtonFor.. so the full "code" is:
#Html.RadioButtonFor(m=>m.Myproperty,"Value 1")
#Html.RadioButtonFor(m=>m.Myproperty,"Value 2")
#Html.ValidationMessageFor(m=>m.MyProperty,"Please select ine of the options")
Any ideas?
have you included these jquery libraries?
jquery-1.9.2.js
jquery.validate.js
jquery.validate.unobtrusive.js
If already, add this css style in page.
.field-validation-valid
{
display: none;
}
.validation-summary-valid
{
display: none;
}

How to style internal elements of a Dart Web Component?

I am playing with the popover component in the Dart "bee" Web Components package (bee)
However, I can't see a way of changing the default styling for internal elements of the component. I want to change the style of the <div class="x-popover-dialog"> so that it has rounded corners. However, if I add the following to my app's css file, it just gets removed by the time it gets to the "out" folder.
.x-popover-dialog {
border-radius: 6px;
}
Is this possible, or is the only way to actually modify the Web Component itself (or perhaps extend it)?
Thanks.
Okay, there are a number of factors here. First, is you cannot redefine a class defined within a component. You can currently apply your own styling to a component if that element does not specify its own styles. For instance, you can change the font-size on on 'p' elements within a component. Or say div#someid { color: red; } but you cannot redefine a class, or add definitions to a class.
The very fact that you can modify the styles at all, unless explicitly allowed, is a bug in the web_ui. Currently tracked as: Issue 374: Support apply-author-styles.
Ideally, when full support is implemented, you will not be able to apply your own styles to a web component unless explicitly permitted by the web-component itself. For more information on apply-author-styles and the related reset-style-inheritance see the great Shadow DOM 201 tutorial.

Rails simple_form gives dots under stars for required fields, better way to remove them?

In many of my projects I use simple_form and love it.
However one really strange quirk that I find is that I get 3 small dots underneath the * it supplies for required fields.
I have to get around it with:
= f.input :name, :label => '*', :required => false # Display purpose only (it is required)
Which is messy because the field is required, so this code looks ugly.
Is there a better fix for what seems like a common problem?
I think it's from CSS, if you are useing blueprint, "abbr and accronym" tags have a border-bottom: 1px dotted black style.
Try add to your css file the next line :
abbr, accronym{ border-bottom: 0px; } /*try adding !important after 0px if doesn't work*/
Wish helps :)
It seems like CSS stuff. See what are the properties for abbr tags on your CSS.
Simple form adds an abbr with a border-bottom.
You can remove the border-bottom just with css, but you also need to override the text underline property (which I think comes from default navigator styles)
So, this small css block should work :
form abbr[title] {
border-bottom: none !important;
text-decoration: none !important;
}
There's another solution that I found, in case anyone else comes across this question in the future. I responded to a similar issue that was closed on simple_form with this:
I had this issue too, and it would be pretty easy for the simple_form
maintainers to change, so it might be worth looking into. At the very
least, I'd like to help if someone else runs into the problem using
the gem combination I'm using. On a new rails 5.2.3 app, with
bootstrap 4.3.1 and simple form 4.1.0, I had the same issue with an
ellipses under the asterisk.
I found a way to solve it, since it actually only happens when using
the tag. In locales/simple_form.en.yml, if you remove mark: '', and
change html: '' to html: '*', this removes the ".." that appears under
the asterisk. This occurs because there's an included style with
bootstrap that adds an underlined dotted border to any abbreviation
tags, which allow the user to select that text in order to view the
rest of the word.

Resources