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");
        });
    
    }
    
  • 相关阅读:
    关于TFS中WorkItem的探究
    Pro Android4 面试题归纳
    truncate 、delete、drop
    获取数据库中所有表的行数及其他信息
    【转】高手速成android开源项目【View篇】
    Can't create handler inside thread that has not called Looper.prepare()解决办法
    Android使用获取HTML
    .net操作EXCEL
    ASP.NET发送邮件
    如何使用 MasterPage
  • 原文地址:https://www.cnblogs.com/wancy86/p/modal_window.html
Copyright © 2011-2022 走看看