This topic is locked
[SOLVED]

  Icon instead of link

2/29/2012 10:26:00 AM
PHPRunner General questions
S
sribeiro_gmr author

Hi,
Any way to replace a detail link in a list view by an icon ?
Best regards.
Sérgio

C
cgphp 2/29/2012

In the "Javascript on load" event of the master list page, enter the following code:

$("a[id^='details_table_name_preview']").html("<img src='path/to/the/icon' />");
C
ckapote 3/1/2012

Dear Cristian
Very interesting !
In my case it is not working
I have a Master table called Hr

and a child table called hr_diplomas_records
I put the following javascript on load of hr ( Master table)
$("a[id^='details_hr_diplomas_records_preview']").html("<img src='diploma.jpg' />");
and nothing is change i mean it does not replace the link with the icon diploma.jpg
Please help
rgds



In the "Javascript on load" event of the master list page, enter the following code:

$("a[id^='details_table_name_preview']").html("<img src='path/to/the/icon' />");


C
cgphp 3/1/2012

This the correct version of the selector:

$("a[id^='hr_diplomas_records_preview']").html("<img src='diploma.jpg' />");


Make sure the image path is correct. Is it a the same level of index.php?

C
ckapote 3/1/2012

Cristian

thank you very much now is working fine .
Is it also possibly when mouse cursor is over the icon to display a label for example DIPLOMAS
If you can help i would realy appreciate it .
Or to make it clear I need to combine below javascript with show hint so when mouse over the diplomas.png to see a message
http://www.asprunner.com/forums/topic/4627-show-hints-in-forms-javascript/
rgds



This the correct version of the selector:

$("a[id^='hr_diplomas_records_preview']").html("<img src='diploma.jpg' />");


Make sure the image path is correct. Is it a the same level of index.php?

C
ckapote 3/2/2012

ok I found it :
$("a[id^='hr_diplomas_records_preview']").html("<img src='diploma.png' TITLE='Diplomas' />");



Cristian

thank you very much now is working fine .
Is it also possibly when mouse cursor is over the icon to display a label for example DIPLOMAS
If you can help i would realy appreciate it .
Or to make it clear I need to combine below javascript with show hint so when mouse over the diplomas.png to see a message
http://www.asprunner.com/forums/topic/4627-show-hints-in-forms-javascript/
rgds

Karlo_from_Germany 4/6/2012

I just tried to create the same thing, but with the same result: No result!!
I have the master-table, called "vorgangsverwaltung", and a child-table, called "asservate".
I tried to use the image "polnds.jpg" instead of the text-link "Asservate".
For this, I used the code, as shown, (JavaScript OnLoad event): ").html("<img src='images/polnds.jpg' />");
Where is the mistake?????

C
ckapote 4/7/2012

Hi pls note that i think that it will work if you have mark Display child records of list page on "inline" and not "popup".



I just tried to create the same thing, but with the same result: No result!!
I have the master-table, called "vorgangsverwaltung", and a child-table, called "asservate".
I tried to use the image "polnds.jpg" instead of the text-link "Asservate".
For this, I used the code, as shown, (JavaScript OnLoad event): ").html("<img src='images/polnds.jpg' />");
Where is the mistake?????

Karlo_from_Germany 4/7/2012



Hi pls note that i think that it will work if you have mark Display child records of list page on "inline" and not "popup".


Thank you, that might be the reason. But I need the pop-up-function, so no chance for changing.
Thanks a lot from germany
Karlo