Icônes » History » Version 8
Elie Soubrie, 22/03/2012 10:18
| 1 | 8 | Elie Soubrie | h1. Icônes dans la livegrid |
|---|---|---|---|
| 2 | 1 | Pablo Alingery | |
| 3 | 8 | Elie Soubrie | Pour remplacer dans la livegrid un lien par une icône il faut dans le fichier client-user/js/def.js |
| 4 | 1 | Pablo Alingery | remplacer |
| 5 | 5 | Pablo Alingery | <pre><code class="javascript"> |
| 6 | 1 | Pablo Alingery | return Ext.isEmpty(value) ? null : "<a href='" + value + "' target='_blank'>" + i18n.get('label.command') + "</a>"; |
| 7 | 7 | Pablo Alingery | </pre></code> |
| 8 | 1 | Pablo Alingery | par exemple par : |
| 9 | 6 | Pablo Alingery | <pre><code class="javascript"> |
| 10 | 1 | Pablo Alingery | return Ext.isEmpty(value) ? null : "<a href='" + value + "' target='_self'>" + "<img src='/sitools/upload/download20.jpg' alt='Download image not found' ALIGN='middle'</img>" + "</a>"; |
| 11 | 5 | Pablo Alingery | </code></pre> |
| 12 | 1 | Pablo Alingery | où |
| 13 | 1 | Pablo Alingery | target='_self' indique que l'on souhaite que le lien s'ouvre dans la page courante |
| 14 | 2 | Pablo Alingery | target='_blank' indique que l'on souhaite ouvrir le lien dans une nouvelle fenêtre / nouvel onglet |
| 15 | 3 | Pablo Alingery | img src='/sitools/upload/download20.jpg indique l'emplacement de l'icône |
| 16 | 1 | Pablo Alingery | Ex : |
| 17 | 5 | Pablo Alingery | <pre><code class="javascript"> |
| 18 | 1 | Pablo Alingery | else if (item.columnRenderer == "externalUrl") { |
| 19 | 1 | Pablo Alingery | renderer = function (value, metadata) { |
| 20 | 1 | Pablo Alingery | metadata.attr = 'ext:qtip="Download this uncompressed data"'; |
| 21 | 1 | Pablo Alingery | //return Ext.isEmpty(value) ? null : "<a href='" + value + "' target='_blank'>" + i18n.get('label.command') + "</a>"; |
| 22 | 1 | Pablo Alingery | |
| 23 | 1 | Pablo Alingery | //Init return |
| 24 | 1 | Pablo Alingery | //return Ext.isEmpty(value) ? null : "<a href='" + value + "' target='_blank'>" + i18n.get('label.command') + "</a>"; |
| 25 | 1 | Pablo Alingery | |
| 26 | 1 | Pablo Alingery | //Pablo modif |
| 27 | 1 | Pablo Alingery | return Ext.isEmpty(value) ? null : "<a href='" + value + "' target='_self'>" + "<img src='/sitools/upload/download20.jpg' alt='Download image not found' ALIGN='middle'</img>" + "</a>"; |
| 28 | 1 | Pablo Alingery | }; |
| 29 | 5 | Pablo Alingery | </code></pre> |