oLanguage feature hides extra toolbar
oLanguage feature hides extra toolbar
John_H
Posts: 5Questions: 0Answers: 0
This is my first posting, so let me start with saying what a fantastic piece of software datatables is!
I have a table with a extra toolbar created like this:
[code]"sDom": 'fr<"#tabletoolbar">ltpi'[/code]
and
[code]$("#tabletoolbar").html(
'AddDelete'
);[/code]
Works great!
However, when I add this:
[code]"oLanguage": { "sUrl": "/public/i18/datatables.dutch.txt" }[/code]
the toolbar is stil drawn (i have a red border around it), but the buttons do not show anymore.
I am using the latest version of Datatables.
Thanks.
I have a table with a extra toolbar created like this:
[code]"sDom": 'fr<"#tabletoolbar">ltpi'[/code]
and
[code]$("#tabletoolbar").html(
'AddDelete'
);[/code]
Works great!
However, when I add this:
[code]"oLanguage": { "sUrl": "/public/i18/datatables.dutch.txt" }[/code]
the toolbar is stil drawn (i have a red border around it), but the buttons do not show anymore.
I am using the latest version of Datatables.
Thanks.
This discussion has been closed.
Replies
Allan
Thanks!
like this:
[code]"fnInitComplete": function(oSettings, json) {
$("#tabletoolbar").html('AddDelete');
$('#DeleteButton').attr('disabled', 'disabled');
$('#AddButton').button().click(function() { $("#dialog-form").dialog("open"); });
$('#DeleteButton').click( function() {
var anSelected = fnGetSelected( oTable );
var id = anSelected[0].getAttribute('id');
deleteRowServer(id, oTable);
} );
}[/code]
quite messy, any thoughts on this?
[code]
"bServerSide": true,
"sAjaxSource": "/admin/getledger",
"fnServerParams": function ( aoData ) {
aoData.push( { "name": "ledger_hasdata", "value": $('#ledgerdata').is(":checked") })
[/code]
in combination with
[code]
"fnInitComplete": function(oSettings, json) {
$("#tabletoolbar").html('Alleen bedragen: ');
$('#ledgerdata').click( function() {
oTable.fnDraw();
});
}
[/code]
The request to the server is made before the checkbox is drawn in state checked ..
[code]
"fnInitComplete": function(oSettings, json) {
$('#placeholder').prependTo($('#tabletoolbar'));
}
[/code]
And somwhere on my page:
[code]
Alleen bedragen:
[/code]
Now, everything can stay as it was, and when the datatable is ready, the toolbar is moved into place.
Thanks for the help.
John