• stingray中modal window


    自定义内容modal window

    //show window for D&B suggestions
    function showDBMatch(resp) {
        console.log('xxx: ', resp);
        html = '';
        for (var i = 0; i < resp.length - 1; i++) {
            html += '<div class="match" style="" title="Please click to select this match.">'
            html += '    <span>' + resp[i].DUNS + '</span>'
            html += '    <br>'
            html += '    <span>' + resp[i].BusinessName + '</span>'
            html += '    <br>'
            html += '    <span>' + resp[i].YearStarted + '</span>'
            html += '    <br>'
            html += '    <span>' + resp[i].SIC + ': ' + resp[i].SIC_Desc + '</span>'
            html += '    <br>'
            html += '</div>'
        }
    
        html += '<div style="clear:both"></div>'
        html += '<div style="margin-top: 20px; text-align: left; margin-left: 10px;">'
        html += '    <button id="DBNoMatchBtn">None of these match</button>'
        html += '</div>'
    
        var $dialogW = $("<div id='DBBox' style=''></div>").html(html).dialog({
            title: 'Business Match(es)',
             660,
            height: 300,
            modal: true,
            autoOpen: false,
            close: function(ev, ui) {
                $(this).dialog("destroy");
            },
            // buttons: {
            //     Cancel: function() {
            //         $(this).dialog("destroy");
            //         return false;
            //     }
            // }
        });
    
        $dialogW.dialog("open");
    
        // bind btn click
        $('#DBNoMatchBtn').die().live('click',function(){
            $dialogW.dialog("destroy");
        });
    
        //bind match select 
        $('#DBBox .match').die().live('click', function(){
            console.log('match: ',$(this).html());
            $('#PQ_DUNS_No').val($(this).find('span').eq(0).text())
            $('#PQ_MemberName').val($(this).find('span').eq(1).text())
            $('#PQ_YrBizStart').val($(this).find('span').eq(2).text())
            $('#PQ_BusinessIndustry').val($(this).find('span').eq(3).text())
    
            $dialogW.dialog("destroy");
        });
    
    }
    
  • 相关阅读:
    【C++】未定义的标识符“_TCHAR*”
    【C++】编写动态库DLL
    【C++】使用SQLite步骤及示例
    【VS】如何查询该项目是什么样工程类型
    新概念英语第一册单词
    地道情景表达一
    日常学习经典口语一
    全国省市区sql脚本
    关于Object.defineProperty
    响应式原理
  • 原文地址:https://www.cnblogs.com/wancy86/p/modal_window.html
Copyright © 2020-2023  润新知