【问题标题】:HTML content appears at first outside of jQuery UI dialogHTML 内容首先出现在 jQuery UI 对话框之外
【发布时间】:2017-02-02 02:50:12
【问题描述】:

HTML:

<div id="printCardModal">
  <table class="table">
    <thead>
      <tr>
        <th>Employee</th>
        <th>Start Time</th>
        <th>End Time</th>
        <th>Start Time</th>
        <th>End Time</th>
      </tr>
    </thead>
    <tbody>
      <!-- ko foreach: employees -->
        <tr>
          <td data-bind="text: name"></td>
          <td><input class="input-medium"></td>
          <td><input class="input-medium"></td>  
          <td><input class="input-medium"></td>    
          <td><input class="input-medium"></td>         
        </tr>  
      <!-- /ko --> 
    </tbody>
  </table> 

  <button  data-bind="click: printCard"> 
    Print
  </button>
</div>

和 JS:

   self.printCard=function(){
     $( "#printCardModal" ).dialog({
        dialogClass: "no-close",
        resizable: true,
        maxHeight: 600,
        width: 1000,
        modal: true,
        buttons: {
          "Create PDF": function() {
            ... 
          },
          Close: function() {
            $(this).dialog( "close" );
          }
        }
     });  
   };

我当然不会写所有东西。上面的 HTML 只是主要 HTML 的一部分。我的问题是 tad 的内容 首先出现在 HTML 主页面中,只有当对话框模式打开时,它才会从主页面获取它(thead 的内容)并呈现到对话框模式. 但是,对于仅出现在模态中的可观察数组员工的内容,一切都很好。 #printCardModal 中的所有内容仅在对话框模式打开时出现,我该怎么办?

【问题讨论】:

标签: html jquery-ui knockout.js


【解决方案1】:
#printCardModal {
  display:none; 
} 

就是这么简单!!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-04-13
    • 1970-01-01
    • 1970-01-01
    • 2011-04-13
    • 2014-08-18
    • 1970-01-01
    • 2015-03-31
    相关资源
    最近更新 更多