How to start the buttons
How to start the buttons
gladsonreis
Posts: 12Questions: 0Answers: 0
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
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
This discussion has been closed.
Replies
Allan
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
Allan