ListIconGadget - right align a column's content

Just starting out? Need help? Post your questions and find answers here.
User avatar
Peter
Posts: 1086
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: ListIconGadget - right align a column's content

Post by Peter »

Dirk Geppert wrote:Thank you Peter. Would it be possible to extend the ListiconGadget() that you can sort with it?
that's not that easy. I'm on it.

Greetings ... Peter
Dirk Geppert
Posts: 282
Joined: Fri Sep 22, 2017 7:02 am

Re: ListIconGadget - right align a column's content

Post by Dirk Geppert »

Okay, I'll wait patiently: -)
the.weavster
Posts: 220
Joined: Sat Mar 01, 2014 3:02 pm

Re: ListIconGadget - right align a column's content

Post by the.weavster »

Sorry, Peter, but I have another request :oops: :

Code: Select all

SetHeaderStyle(Gadget,BackColor.s,TextColor.s,Height)
User avatar
Peter
Posts: 1086
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: ListIconGadget - right align a column's content

Post by Peter »

the.weavster wrote:Sorry, Peter, but I have another request :oops: :

Code: Select all

SetHeaderStyle(Gadget,BackColor.s,TextColor.s,Height)
BackColor and TextColor are not that difficult. But setting the text height will be a challenge...

Greetings ... Peter
the.weavster
Posts: 220
Joined: Sat Mar 01, 2014 3:02 pm

Re: ListIconGadget - right align a column's content

Post by the.weavster »

Peter wrote:BackColor and TextColor are not that difficult.
I'd happily settle for that :)
User avatar
Peter
Posts: 1086
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: ListIconGadget - right align a column's content

Post by Peter »

the.weavster wrote:I'd happily settle for that :)
ok ;-)

paste this on in DeclareModule ListIconGadgetEx:

Code: Select all

Declare SetColumnHeaderColor(Gadget, Column, BackColor.s, FrontColor.s)
and this one in Module ListIconGadgetEx:

Code: Select all

Procedure SetColumnHeaderColor(Gadget, Column, BackColor.s, FrontColor.s)
  GetGrid
  ! var id = "ligchc_" + grid.id + "_" + v_column;
  ! $("#" + id).remove();
  ! $("<style id='" + id + "'>" + "#" + grid.id + " .dgrid-column-" + v_column + "[role='columnheader'] { color: " + v_frontcolor + "; background-color: " + v_backcolor + "; }</style>").appendTo("head");
EndProcedure
you can call it with:

Code: Select all

ListIconGadgetEx::SetColumnHeaderColor(#yourListIconGadget, 0, "red", "yellow") ; setting the color for first columnheader
Greetings ... Peter
the.weavster
Posts: 220
Joined: Sat Mar 01, 2014 3:02 pm

Re: ListIconGadget - right align a column's content

Post by the.weavster »

Thanks :D
Post Reply