Apply multiple field styles

amala2
Mega Guru

I am trying to apply two field styles on the incident Number field.Below are the 2 field styles:

1.If state is In Progress , field style used is "text-align:right"

2.If Priority is P1 , field style used is "background-image: url('myIcon.gif');"

So when an Incident State is In Progress & Priority is P1 ,only the "text-align:right" is getting applied.But I want both the styles to get applied.

Kindly help.

1 ACCEPTED SOLUTION

Try this


Create a third style merging those 2 conditions



Condition: javascript: current.state =='3' &&   current.priority =='1'



Value :


background-image: url('myIcon.gif');


padding-right: 30px;


background-position: 98% 6px;


background-repeat: no-repeat;


text-align:right


View solution in original post

8 REPLIES 8

Aakash Shah4
Tera Guru

Hello Amala,



Could you please share your code.


Hi Akash,



I have created 2 field styles which is as below:



1.Table : Incident,Field : Number


    Condition: javascript: current.state =='3'


    Value : text-align:right



2.Table : Incident,Field : Number


    Condition: javascript: current.priority =='1'


    Value :


background-image: url('myIcon.gif');


padding-right: 30px;


background-position: 98% 6px;  


background-repeat: no-repeat;






Try this


Create a third style merging those 2 conditions



Condition: javascript: current.state =='3' &&   current.priority =='1'



Value :


background-image: url('myIcon.gif');


padding-right: 30px;


background-position: 98% 6px;


background-repeat: no-repeat;


text-align:right


Thanks for your reply Aakash.



In the value field of field style where we provide the condition ,can we pass current object to a script include & evaluate the result


For eg: javascript: new fieldSI().getfieldStyle(current)



When I tried to do it,in the script include   I am getting the field values as undefined



In the script include,


getfieldStyle:function(ob)


{


gs.log(ob.state)// this is returnnig undefined


}