This topic is locked

Best way to popup a multiline text field?

1/22/2019 5:41:17 PM
PHPRunner General questions
K
KevinMillican author

PHPrunner 9.8 Build 31882

One useful feature of PHPrunner is that it can truncate long text fields which then popup and show you the full contents in a dialog box.
I'd like to do this for a specific field in list view only but it seems to be a global for all pages and views.
There seem to be a few ways I could try to achieve this but I'm wondering if someone's already come up with a good solution?
Possibilities include:

  • modifying a page event so that the truncate long text only works in the one location (possibly combined with a custom format)
  • creating a hyperlink field that uses the same dialog as the truncate long text option
  • creating a hyperlink field that opens a custom view (I tried this but could only get it to work on a new window/tab)
  • using a mouseover event or field event to create a hint
  • inserting a button with some custom javascript code



Ideally I'd like to use a mouseover event that reacts when I hover over one field and temporarily displays the information from another field in a hint. This information would stay until I moved the mouse off the hint text (thereby allowing be to copy the field text if needed).

Thoughts on the best way to achieve this and sample code if anyone has some?
Thanks.

K
KevinMillican author 1/23/2019

For now, this is working well:-
Set the Status field properties to be a custom format for just the List and View pages.
Using the following code to display the Comments field when I hover over the hyperlink :-
[font="Courier New"]$value="<a href=\" \" title=\"".$data["Comments"]."\">".$value."</a>";
I'll leave it a week to see if anyone has any other suggestions (specifically that avoid the need for the Status field to look like a link), but if not, I'll mark as solved.