When click on button redirect to new page but POST variable from selected row(s) in table
When click on button redirect to new page but POST variable from selected row(s) in table
brisc101
Posts: 3Questions: 0Answers: 0
First off, this is a great tool. Great support for this tool as well.
I've been looking on the forums and I can't quite seem to find what I am trying to do. I've always worked in php, but not great at JS.
I created a "Edit device" button, and when it's clicked I want to redirect to another page (manage.php) and I want to pass data to that manage.php with the contents of only the selected rows from the table. I just need the first column to be passed (Model).
Basically I want the Edit button to do this
I've been looking on the forums and I can't quite seem to find what I am trying to do. I've always worked in php, but not great at JS.
I created a "Edit device" button, and when it's clicked I want to redirect to another page (manage.php) and I want to pass data to that manage.php with the contents of only the selected rows from the table. I just need the first column to be passed (Model).
Basically I want the Edit button to do this
This discussion has been closed.
Replies
[code]
"fnClick" : function (nButton, oConfig, flash) {
// Is there a better way to do this?
// window.location.replace("manage.php?id="??);
}
[/code]
Anyone have any ideas?
Thanks!
[code]
"fnClick": function ( nButton, oConfig ) {
var oTT = TableTools.fnGetInstance( 'example' );
var sData = oTT.fnGetSelectedData();
if (sData.length = 1) {
window.location.href = "manage.php?search="+ sData;
return false;
}
}
[/code]
Depending on how many rows you have selected, sData is pretty big. I ended up parsing the data that I needed in manage.php as I couldn't figure out how to just pass the first column (Model) only to manage.php
Thanks for posting.
Same problem here. Though I want to transfer data through POST method by .ajax()..
Any guidance on this question are welcome. :-)
Allan
Thanks