Table Tools - user select and 'Email Button'

Table Tools - user select and 'Email Button'

matyhatymatyhaty Posts: 11Questions: 1Answers: 0
edited July 2011 in General
Hi All

Ive been trying to get the following working, but seem to have come up failling....
Im now wondering if I have mis understood some of the docs.... Could anyone point me in the right direction?

Im using Table Tools Extra (And ColVis)....
Im trying to make an additional button (Along with the select none/all and user select options) which will call a url, and string together a load of IDs (say from column 0)

The point of this is to pass user IDs to the 'email form' so users can be emailed by selecting people from the table...

Def a few pints in it for anyone who can help out!

I'll post up anything ive tried on pastebin if it helps, but its all a bit of of a muddle......

Many Thanks

Matt

Replies

  • matyhatymatyhaty Posts: 11Questions: 1Answers: 0
    What I have so far:

    [code]


    $(document).ready(function() {
    oTable = $('#as_datatable').dataTable({
    'bJQueryUI': true,
    'sPaginationType': 'full_numbers',

    "sDom": 'CTlfrtip',



    "oColVis": {
    "activate": "mouseover"
    },
    "oTableTools": {
    "sSwfPath": "http://pro.local/~matt/Teamleaf2/swf/copy_cvs_xls_pdf.swf",

    'aButtons': [
    {
    'sExtends': 'text',
    'sButtonText': 'Hello world'
    }],

    },
    'sScrollY': '250',
    'bPaginate': false,



    "aoColumnDefs": [
    { "bVisible": false, "aTargets": [ ] }
    ]

    });
    } );
    [/code]

    I dont understand how I can use that button (which currently doesn't do much of course
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Are you not currently getting a Javascript error from that code? The quoting of the value for sSwfPath looks a bit odd (as shown by the syntax highlighting above). What you need to do with your custom button is override the fnClick method ( http://datatables.net/extras/tabletools/button_options#fnClick ) and have the function open the user's mail client with the mailto "protocol". window.location.href = "mailto:someone@somewhere.com" for example.

    Allan
This discussion has been closed.