How to start the buttons

How to start the buttons

gladsonreisgladsonreis Posts: 12Questions: 0Answers: 0
edited April 2013 in TableTools
Hello !
good day
How to start the buttons in this code below !
Please

[code]
$(document).ready(function() {
// Create the form
var editor = new $.fn.dataTable.Editor( {
"ajaxUrl": "php/browsers.php",
"domTable": "#example"
} );

editor.add( [
{
"label": "Browser:",
"name": "browser"
}, {
"label": "Rendering engine:",
"name": "engine"
}, {
"label": "Platform:",
"name": "platform"
}, {
"label": "Version:",
"name": "version"
}, {
"label": "CSS grade:",
"name": "grade"
}
] );

// New record
$('button.editor_create').on('click', function (e) {
e.preventDefault();

editor.create(
'Inclusão',
{
"label": "Gravar",
"fn": function () {
editor.submit()
}
}
);
} );

// Edit record
$('#example').on('click', 'a.editor_edit', function (e) {
e.preventDefault();

editor.edit(
$(this).parents('tr')[0],
'Editando',
{
"label": "Atualizar",
"fn": function () { editor.submit(); }
}
);
} );

// Delete a record
$('#example').on('click', 'a.editor_remove', function (e) {
e.preventDefault();

editor.message( "Desejas realmente deletar este registro?" );
editor.remove(
$(this).parents('tr')[0],
'Atencao',
{
"label": "Deletar",
"fn": function () {
editor.submit()
}
}
);
} );

// DataTables init
$('#example').dataTable( {
"sAjaxSource": "php/browsers.php",
"aoColumns": [
{ "mDataProp": "browser" },
{ "mDataProp": "engine" },
{ "mDataProp": "platform" },
{ "mDataProp": "version", "sClass": "center" },
{ "mDataProp": "grade", "sClass": "center" },
{
"mDataProp": null,
"sClass": "center",
"sDefaultContent": 'Edit',
"bSortable": false,
"bSearchable": false
},
{
"mDataProp": null,
"sClass": "center",
"sDefaultContent": 'Delete',
"bSortable": false,
"bSearchable": false
}
]
} );
} );
[/code]

Thanks

Replies

  • allanallan Posts: 63,494Questions: 1Answers: 10,470 Site admin
    I'm not quite sure what you mean I'm afraid? Are the links not working? Can you link to a test page showing the problem please?

    Allan
  • gladsonreisgladsonreis Posts: 12Questions: 0Answers: 0
    Actually, this is a fragment of the code example, and I would like to put the buttons for PDF, Print and EXELL the
    TableTools, I try to enter the code:

    [code]
    // DataTables init
    $('#example').dataTable( {
    "sDom": 'T<"clear">lfrtip',
    "oTableTools": {
    "sSwfPath": "/swf/copy_csv_xls_pdf.swf"
    }
    "sAjaxSource": "php/browsers.php",
    "aoColumns": [
    { "mDataProp": "browser" },
    { "mDataProp": "engine" },
    [/code]

    When I run does not appear anything.
    I'm still updating my server to PHP 5.4 to put online test
  • allanallan Posts: 63,494Questions: 1Answers: 10,470 Site admin
    I see - you want to use TableTools? Okay, the code above looks like it should work. I'd need a link to the page you are working on to say why it isn't.

    Allan
This discussion has been closed.