Custom Buttom to external link with GET data
Custom Buttom to external link with GET data
Hi i have the editor and i want to perform a custom button with GET data to a external link. The GET data must be de ID of the ROW. Here is the link of the web page with the button displayed http://www.eliseoweb.com.ar/test/. I don't know how to add a the ID data to the button. Heres my code, i get this code from other post of the forum.
{"sExtends": "text",
"sButtonText": 'Custom Buttom',
"fnClick": function ( nButton, oConfig, oFlash ) {
window.open('http://www.midominio.com.ar?id=$ID', '_blank');
console.log('nButton: ', nButton);
console.log('oConfig: ', oConfig);
console.log('oFlash: ', oFlash);
},
"fnInit": function ( nButton, oConfig ) {
$(nButton).addClass('btn btn-primary m-r-5 m-b-5');
}}
The button must be disable (Like update or Remove) until the user select a row. The objetive of this button is to provide the user a template of the row for printing in a envelope.
Thanks
Federico
This question has an accepted answers - jump to answer
Answers
Hi,
It sounds like you want to use the
select_single
button type. Just add anfnClick
action to make the Ajax request you need.You can get the data for the selected row use the
fnGetSelectedData
TableTools API method. This is what the Editor buttons are doing as well!Allan
Solved this way
Thanks Allan
Nice one - thanks for showing us your code.
Allan