Page 1 of 1

sflgrid header

Posted: Thu Nov 19, 2015 6:49 am
by tpataki
Hi,
is there the possibility to display the filter icon permanently or to implement an own tooltip for the header area ?
Thanks

Re: sflgrid header

Posted: Thu Nov 19, 2015 1:56 pm
by Scott Klement
You could overlay the header with a label, and put a tooltip on the label. Would that work?

A more complex solution... you can put HTML in your column headings. So with thata, you could easily put a tooltip, icon, javascript, etc

Re: sflgrid header

Posted: Thu Nov 19, 2015 4:03 pm
by tpataki
which means HTML in the column headings ?

Re: sflgrid header

Posted: Thu Nov 19, 2015 7:13 pm
by Scott Klement
You can insert HTML tags inside your column headings to do things. For example, you asked about a "tool tip" on your column headings... Internally, when you use the "tool tip" property in PUI, it puts an HTML 'title' attribute on the HTML tag when it builds the widget, which causes the browser to display a tool tip when you mouse over the widget.

In this example, I want it to say "My Tool Tip Data" when you mouse over the 2nd column of a grid, like this:
tooltip1.png
tooltip1.png (5.27 KiB) Viewed 1233 times
To do that, I can edit the column headings property of my grid. Column headings is a comma separated list of headings. PUI will split this list by the commas, and insert each piece into the page. So if you have HTML tags in between the commas, they will be interpreted by the browser. If you want to hard code the tool tip in the display file settings, you can right-click the "column headings" and choose "open in editor"
tooltip2.png
tooltip2.png (24.64 KiB) Viewed 1233 times
In the editor, enter the HTML tag for <span> (span is a division of HTML data that all fits in one paragraph/element/line) with a title attribute like this:
tooltip3.png
tooltip3.png (7.53 KiB) Viewed 1233 times
Or, if the tool tip data will vary, you can bind the "column headings" property to an RPG variable, and build the same comma-separated list from data in your RPG program. The bound field should be character, and large enough to fit all of the column headings separated by commas, plus the HTML code.
tooltip4.png
tooltip4.png (14.08 KiB) Viewed 1233 times
Then you can build the same comma-separated list in your RPG program, and if desired, calculate the field values on-the-fly. (Or load them from databases, etc.)
tooltip5.png
tooltip5.png (4.5 KiB) Viewed 1233 times

Re: sflgrid header

Posted: Fri Nov 20, 2015 4:51 pm
by tpataki
Hi, Scott,
That's a great thing.
Thanks for your help.