Custome button to url
Custome button to url
I've looked everywhere for this, all I want to do is add a button beside the create | edit buttons that will point to a url.
heres what I'm using thus far, the button shows but I'm not getting any URL loading:
// Display the buttons
new $.fn.dataTable.Buttons( table, [
{ extend: "create", editor: editor , className: "btn btn-success"},
{ extend: "edit", editor: editor , className: "btn btn-primary" },
{ sExtends: "text",
text: "New Record",
fnClick: function ( nButton, oConfig, oFlash ) {
window.location = "http://www.google.co.uk"
}
},
I'm sure there are others who have done this, anyone else know how to do it?
Tom
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
There is no
fnClick
in Buttons. See the documentation for how to create a custom button. Just use theaction
function to set the location.Allan
DUH..!
Many thanks Allan - I had no idea it would have been so simple, thanks for your help.