zoukankan      html  css  js  c++  java
  • 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");
        });
    
    }
    
  • 相关阅读:
    【大话设计模式】——浅谈设计模式基础
    mongodb入门安装
    Unity3D研究之多语言用中文做KEY
    java7新特性之Try-with-resources (TWR)
    ORACLE取周、月、季、年的開始时间和结束时间
    topas命令详解
    topas解析(AIX)
    top(topas),vmstat,iostat在linux和AIX操作系统下显示情况
    怎么检查网站的死链接呢?
    网站死链接检测查询工具
  • 原文地址:https://www.cnblogs.com/wancy86/p/modal_window.html
Copyright © 2011-2022 走看看