How to conditionally enable style in styled components? - styled-components

I have a string in props, depending on its value I want to give a property different value, or NO value at all, like I haven't specified it at all. How to?

Related

OData value (color) applied to SAPUI5 table

I wanted to know if the following is possible:
I've got an oData which has two fields related with colors
Colors are set as RGB because I thought it would be easier to pick them up to use it as styles in frontend.
I have a table in which I want to assign these colors to a specific cell, depending on 'ORGNA'.
I would like the row to have background-color red where Especialidad="UROLOGIA" (for example), but that color must come from the OData values I've got stored(see first image).
'ORGNA' values are the ones shown as 'Especialidad' (which means that 39ONC would be shown as 'Oncologia' and so on in the table).
I also wanted to know if this is possible or they must be set specifically from a Styles.css file.
Maybe there's some property like setColor or is there any way to add a background-color tag inside my XML View passing that OData values?
If you need any additional code, please just let me know.

Is it possible to get localized value of boolean expression in PrimeFaces?

I use primefaces <p:datatable> component for displaying table data. Among the others, the table contains column with boolean values expressed by <p:selectBooleanCheckbox> component (chosen because of nice look).
However, when I try to export data using <p:dataExporter>, PF always renders logical values as 'true' or 'false' independently from the language. I would like to have values of those components rendered in language which I set in locale.
I have made localization of PrimeFaces calendar by adding global variable
PrimeFaces.locales['pl']= {...}
to javascript supporting PF and it works great for <p:calendar> component. Is it possible to do the same for boolean values?

JointJs: Set Custom attribute Value

I am trying to set custom attribute value through a form. But if I click the element again it shows the properties previously assigned rather than showing the one.
I want to input SiteStation variable's value from user and assign it to that particular element. For the time my element is there on the graph it should have that value attatched it.
http://jsfiddle.net/avinash2618/6umUH/157/
cell.set('attributes/stationName',stationName);
you can try setting the text property of the custom attribute as below
cell.attr('stationName/text', stationName);
or
if it is a view
cellView.model.attr('stationName/text', stationName);

Set Default Field Value Based on Site Property

I am looking for a way to set a list field default value to a property that I have programmatically set on the site where the list resides.
Essentially every item in the list will have the same value which will be hidden from the normal user view. Down stream, I am using a content query web part to pull that field so I can group on it.
I am using SP2013.
Thanks for the help
With Site Properties you mean the SPSite.RootWeb.AllProperties property bag which you have filled with some custom property?
Assuming that is what you are talking about, there are unfortunately no standard ways to work with property bags - besides programming that is.
You said you want to set a default value on a list field for each list item. This sounds like an event receiver! You can choose to have it fire on item updating and/or item created for all your items and always set the hidden field on the item with the value from the site properties.

Query with servicestack property display name

I have some issue regarding display name of property in result of get request on servicestack.
I will get following result when i make get request to my servicestack, in that in list i have not bind count although it is displaying here (I think because of type (int)).
So my questions are
1) Is there any way to avoid property to displaying on Result? (want to disable count here)
2) Is there any way to rename property display name ? (want to display countvalue instead of count here)?
Thanks in Advance.
The value of 0 for count is displayed because that's what value is embedded in the JSON. If you don't want it displayed then you want to suppress the value from being serialized. If you make count property nullable (i.e. change from int to int?) then it wont be displayed when it doesn't have a value.
At the moment there is no way to customize the header label of each column other than changing the name of your DTO property to CountValue.

Resources