How fill entire row any colors in window?

148 views
Skip to first unread message

NikColonel

unread,
Jul 18, 2018, 4:21:47 AM7/18/18
to iDempiere

Good day
I created for my company the function of fill background a row in a window with different colors.

How add background in row?

  • Open the settings for the required field
  • Input SQL valid query in field "Color Logic". Query must return HTML valid color (example: 'green', '#582c2c', 'rgb(88, 44, 44)')
  • Select checkbox "Fill entire line"

How add background in cell?

  • Open the settings for the required field
  • Input SQL valid query in field "Color Logic". Query must return HTML valid color (example: 'green', '#582c2c', 'rgb(88, 44, 44)')

Example SQL query:

 - SELECT CASE WHEN '@DocStatus@' = 'NA' THEN '#ffcccc' 
	       WHEN '@DocStatus@' in ('AP', 'IP') THEN '#ebce83' 
	       WHEN '@DocStatus@' in ('VO', 'RE') THEN '#cccccc' 
	       WHEN '@DocStatus@' = 'DR' THEN '#ccccff' 
   END
 - SELECT CASE WHEN '@IsVendor@' = 'true' THEN '#99ccff' END
 - SELECT CASE WHEN '@Name@' LIKE '%Store%' THEN 'rgb(255, 204, 204)' END


JIRA: https://idempiere.atlassian.net/browse/IDEMPIERE-3750


Best regards
Palich.ru Development Team

1.png

Oleg Oraskin

unread,
Jul 18, 2018, 4:38:42 AM7/18/18
to iDempiere
Good afternoon, wonderful addition, we would be glad to use it in our project

Nicolas Micoud

unread,
Jul 18, 2018, 10:41:27 AM7/18/18
to iDempiere
Hi,

Just my 2 cents, but what the difference with CSS Styles (http://wiki.idempiere.org/en/NF4.1_Styles_On_Fields) ?
For the "Fill entire line", perhaps the CSS style field could be added on AD_Tab ?

Regards,

Nicolas

Marco Longo

unread,
Jul 18, 2018, 11:07:35 AM7/18/18
to iDempiere
We use what is on core  (CSS style) :-D 

yellow  = order draft
green   = order completed
text blue = order shipped (all)
border red = invoice draft
border green =invoice completed
border blud = invoice paid (all)



All line colored on ad_tab ?.. why not but i don't like to many colors .  
I'm already happy with CSS style :-D

Marco

Hiep Lq

unread,
Jul 18, 2018, 11:39:32 AM7/18/18
to Mohemmed Bilal Ilyas
inlineStyle apply to content (field). 
maybe add outterStyle and to apply to cell so we can adjust whole line



--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/4a0168ab-9e4b-4e33-b518-d6b5679eee55%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Lê Quý Hiệp
Email: hie...@hasuvimex.vn
Skype: admin.hasuvimex

Company: Thanh Hoa Fishery Import - Export J.s.c  (HasuvimexDL 47
Add: Lot E, Le Mon Industrial Zone, Thanh Hoa, Vietnam

Carlos Antonio Ruiz Gomez

unread,
Jul 18, 2018, 2:06:26 PM7/18/18
to idem...@googlegroups.com
Thanks Nik for contributing your code and ideas!!!

However, I tend to agree with this thread - it would be better to expand on the CSS style.

One of the issues I see with your approach is being based on SQL - that would impact the performance of the database if heavily used.

In the case of CSS we made it to work with context Display Logic because of that, the colors are usually recalculated on the fly on every change on dependent fields - so, doing it via SQL can mean a lot of visits to the database.

I guess in principle - if you want to apply a style to the whole row, it can be a matter of assigning the same CSS style to all fields?

Regards,

Carlos Ruiz




On 18.07.2018 at 17:39, 'Hiep Lq' via iDempiere wrote:
inlineStyle apply to content (field). 
maybe add outterStyle and to apply to cell so we can adjust whole line


On Wed, Jul 18, 2018 at 10:07 PM, Marco Longo <longo....@gmail.com> wrote:
We use what is on core  (CSS style) :-D 

yellow  = order draft
green   = order completed
text blue = order shipped (all)
border red = invoice draft
border green =invoice completed
border blud = invoice paid (all)

All line colored on ad_tab ?.. why not but i don't like to many colors .  
I'm already happy with CSS style :-D

Marco


Il giorno mercoledì 18 luglio 2018 16:41:27 UTC+2, Nicolas Micoud ha scritto:
Hi,

Just my 2 cents, but what the difference with CSS Styles (http://wiki.idempiere.org/en/NF4.1_Styles_On_Fields) ?
For the "Fill entire line", perhaps the CSS style field could be added on AD_Tab ?

Regards,

Nicolas




Le mercredi 18 juillet 2018 10:38:42 UTC+2, Oleg Oraskin a écrit :
Good afternoon, wonderful addition, we would be glad to use it in our project
--


--
Lê Quý Hiệp
Email: hie...@hasuvimex.vn
Skype: admin.hasuvimex

Company: Thanh Hoa Fishery Import - Export J.s.c  (HasuvimexDL 47
Add: Lot E, Le Mon Industrial Zone, Thanh Hoa, Vietnam
--

NikColonel

unread,
Jul 18, 2018, 2:07:21 PM7/18/18
to iDempiere
We work with idempiere 3.1 and this is missing function (http://wiki.idempiere.org/en/NF4.1_Styles_On_Fields)
But i tested my code on idempiere 5.1

Sorry, if my code is full duplicate is http://wiki.idempiere.org/en/NF4.1_Styles_On_Fields 

When we upgrade to version 5.1, we will use this http://wiki.idempiere.org/en/NF4.1_Styles_On_Fields 
But it is important for us to fill entire line with the color.
Reply all
Reply to author
Forward
0 new messages