Create modal form dialog in function

Posted by Hainlp on Stack Overflow See other posts from Stack Overflow or by Hainlp
Published on 2012-06-01T04:32:26Z Indexed on 2012/06/01 4:41 UTC
Read the original article Hit count: 145

Filed under:

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()');

© Stack Overflow or respective owner

Related posts about jQuery