Create modal form dialog in function
- by Hainlp
My app works with many modal form dialogs, i want to create modal form dialog by call a function, but i get error when i click OK button on dialog "i.apply is not a function". My code below
html:
<div id="dlg_srch_acnt">
<table cellpadding="0" cellspacing="0" border="0" class="display" id="dtl_acnt_srch" style=" padding-bottom:0px;">
<thead>
<tr>
<th>Id</th>
<th>Account name</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
Script
function init_dlg(id, autoOpen, height, width, modal, fn_button1)
{
id.dialog({
autoOpen:autoOpen,
height:height,
width:width,
modal:modal,
buttons:{
'OK':fn_button1,
},
close:fn_close
});
}
function fn_ok()
{
$('#parnt_acnt').val(acnt_name);
$('#dlg_srch_acnt').('close');
}
init_dlg($('#dlg_srch_acnt'), false, '440', '480', true, 'fn_ok()');