Nicer create button
Nicer create button
nskwortsow
Posts: 120Questions: 0Answers: 0
Hi,
How can I style the title of the modal, and the create button (it should say "Save" and be styled with specific bootstrap classes)?
Thanks,
Nathan
CURRENT CODE
"oTableTools": {
//"sRowSelect": "single",
"aButtons": [
{ "sExtends": "editor_create", "editor": editor_faqCategories }
]
},
How can I style the title of the modal, and the create button (it should say "Save" and be styled with specific bootstrap classes)?
Thanks,
Nathan
CURRENT CODE
"oTableTools": {
//"sRowSelect": "single",
"aButtons": [
{ "sExtends": "editor_create", "editor": editor_faqCategories }
]
},
This discussion has been closed.
Replies
{
"sExtends": "editor_create",
"editor": editor_faqCategories
"sButtonClass": "... classes ...",
"sButtonText": "Save"
}
[/code]
The full list of TableTool button options are available here: http://datatables.net/extras/tabletools/button_options
Allan
So the buttons in the "create new record" modal for the EDITOR.
E.g.
editor_faqCategories.buttons( [
{
"label": "Cancel",
"className":"btn btn-link",
"fn": function () {
editor_faqCategories.close();
}
},
If you don't want to pass button defs into the API methods you can alter the buttons which the default TableTools buttons defined by Editor put in by using `TableTools.BUTTONS.editor_create` . That's just a button object like that which is passed into the API methods.
Allan
TableTools.BUTTONS.editor_create.formButtons = [
{ "label": null, "fn": function (e) { this.submit(); } }
];
[/code]
is the default button for the create button, so you'd add className onto that:
[code]
TableTools.BUTTONS.editor_create.formButtons[0].className = "btn btn-link";
[/code]
for example.
Allan