[SOLVED] Adding a custom button to default button group of list view

sakyildiz

Member
How can i add a custom button to the button group (e.g. add record, group by, csv, rss, ...) of the list view which I can attach some javascript code?
 
The easiest way would be to create and add the button via jQuery/javascript and put it in the list_x.js file.
Something like?...
JavaScript:
jQuery('<a id="jsLink" href="#_" class="btn"><i class="icon-link"></i> Click Me</a>').appendTo('ul.nav-pills');

jQuery("#jsLink").click(function(event){
    event.preventDefault();
    jsCode();
});
Remove the 'btn' class if you want it to look like the other links in the nav-pills instead of a button. You can also reference the id to add some special styling via css if needed.

Here's a good link to Joomla 3 Icomoon Icons if you want to select a special icon. http://ma.tvtmarine.com/en/blog/112-joomla-icomoon-icons-directory
 
Last edited:
Thank you very much. It worked. However, i had to add the list tag to make the link look like the other nav-pills. The result is like..
JavaScript:
jQuery('<li><a id="jsLink" href="#_"><i class="icon-print"></i> Print</a></li>').appendTo('ul.nav-pills');

jQuery("#jsLink").click(function(event){
    event.preventDefault();
    //My jsCode();
});
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top