Tabletools - get selected data to URL

Tabletools - get selected data to URL

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

After a few hours, I have got this working. I cant seem to work out how to post to the URL a '_' seperated list of values from column 0 (e.g. 1_2_3_5_6 etc)

[code]
$buttons = "
'aButtons': [ 'csv',
'pdf',
'print',
{
'sExtends': 'select_all',
'sButtonText': 'All'
},
{
'sExtends': 'select_none',
'sButtonText': 'None'
},
{
'sExtends': 'text',
'sButtonText': 'Email',
'mColumns': [ 0 ],
'fnClick': function ( nButton, oConfig, oFlash ) {
//window.location = '".site_url()."/communicates/view';




}

}],
";
[/code]

How can you query the table when the email button is click to call '".site_url()."/communicates/view/1_2_3_4_6';

Thanks

Matt

Replies

  • matyhatymatyhaty Posts: 11Questions: 1Answers: 0
    For those who stumble accross this - this is what i ended up with.
    Its hardly pretty, but i couldnt get the information from the Datatable Object (Simply did not find out how)

    [code]
    $buttons = "
    'aButtons': [ 'csv',
    'pdf',
    'print',
    {
    'sExtends': 'select_all',
    'sButtonText': 'All'
    },
    {
    'sExtends': 'select_none',
    'sButtonText': 'None'
    },
    {
    'sExtends': 'text',
    'sButtonText': 'Email',
    'mColumns': [ 0 ],

    'fnClick': function ( nButton, oConfig, oFlash )
    {
    var ids = '';
    $('.DTTT_selected td:first-child').each(function() {
    var text = $(this).text();
    //alert(text);
    ids += text+'_';
    });
    window.location = '".site_url()."/communicates/view/'+ids

    }


    }],
    ";
    [/code]

    If anyone sees this and realises a better way, without having to traverse the document with JQuery please let me, and everyone know!!!

    Regards
  • matyhatymatyhaty Posts: 11Questions: 1Answers: 0
    For a partial solution see:
    http://www.datatables.net/forums/discussion/5613/datatables-with-colvis-tabletools-and-custom-buttons-codeigniter-example#Item_1

    Regards
    Matt
    www.s3d.co.uk
This discussion has been closed.