javascript - Passing table row data from dialog window to main page table -
this table on main page :
<table> <th>apple</th> <th>ball</th> <tr> <td><input type="text" /></td> <td><input type="button" /><a href="#"></a></td> </tr> <tr> <td><input type="text" /></td> <td><input type="button" /><a href="#"></a></td> </tr> </table>
this table on window dialog :
<table> <th>apple on dialog</th> <th>ball on dialog</th> <tr> <td>a1</td> <td>a2</td> <td>a3</td> </tr> <tr> <td>b1</td> <td>b2</td> <td>b3</td> </tr> </table>
see fiddle, not working code wanted result page,because don't know how create window dialog on jsfiddle bare fiddle. everyone.
please check jsfiddle
you have save/pass clicked btn's identity dialog knows re-create , paste content. hope jsfiddle gives idea
$(document).ready(function(){ $('#1, #2').click(function(){ window.clickedbtnid = $(this).attr('id'); $( "#table_dialog_1" ).dialog(); }); $( "#table_dialog_1" ).find('td').click(function(){ $('#'+window.clickedbtnid).parent().prev().find('input').val($(this).text()); $( "#table_dialog_1" ).dialog('close'); }) });
javascript jquery html css
No comments:
Post a Comment