NG client CSS: fied VS. svy-field, .svy-textfield

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

NG client CSS: fied VS. svy-field, .svy-textfield

Postby imre_tokai » Mon Apr 11, 2016 11:50 am

Hello,

In Servoy 8.0.2 NG client,
how to properly assign style to a field placed on form (mode Table view)?

Further, goal is to alternate row color (like onRender event was used in previous versions)? Was able to achieve it for label by simply removing prefix from .css as described in section Changes from previous version and building
Code: Select all
.ui-grid-row-selected div.ui-grid-cell

https://wiki.servoy.com/display/public/DOCS/Styling+in+the+NGClient
Have also tried to find proper technique in sample solution servoy_sample_ng_basic.servoy

How to elegantly build fancy, context-sensitive field in NG client?

Regards
Imre Tokai, Software Engineer
iTech Professionals, Inc.
User avatar
imre_tokai
 
Posts: 33
Joined: Mon Mar 26, 2012 12:18 pm

Re: NG client CSS: fied VS. svy-field, .svy-textfield

Postby jcompagner » Tue Apr 12, 2016 6:57 pm

you can target a field that is inside a tableview by using something like this:

.ui-grid-cell .svy-field {
background-color: red
}

what do you mean with context-sensitive?
So styling based on data? For this we need special labels

8.0.3 has a onrenderlabel (as a first example): https://github.com/Servoy/servoy-client ... label.spec

for that we have a styleclassexpression wich can be a calculation what returns a class name based on any data that you want to use.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: NG client CSS: fied VS. svy-field, .svy-textfield

Postby imre_tokai » Wed Apr 13, 2016 8:43 pm

Thanks a LOT Johan,

This is the needed snippet
Code: Select all
.ui-grid-row-selected div.ui-grid-cell .svy-field

By context I meant Table VS Record view of the form and was able to use your guideline for both.

Great theoretical hints on onrenderlabel + styleclassexpression also, thanks again!

Regards
Imre Tokai, Software Engineer
iTech Professionals, Inc.
User avatar
imre_tokai
 
Posts: 33
Joined: Mon Mar 26, 2012 12:18 pm


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 8 guests

cron