Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/446.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 将表中单击的行的结果绑定到另一个表中的另一行_Javascript_Html_Jquery_Knockout.js - Fatal编程技术网

Javascript 将表中单击的行的结果绑定到另一个表中的另一行

Javascript 将表中单击的行的结果绑定到另一个表中的另一行,javascript,html,jquery,knockout.js,Javascript,Html,Jquery,Knockout.js,我有一个表和一个搜索链接作为它的一列。当我单击搜索时,会弹出一个带有搜索框选项的ajax弹出扩展面板。搜索通过webservice调用完成,结果绑定在面板内的一个表中。我使表行可单击,并希望单击的行绑定到第一个表。我遇到的问题是跟踪每一行。当我单击面板中的一行时,第一个表中的所有行都被绑定,而不仅仅是那一行。我不知道如何跟踪我单击的行。非常感谢您的帮助,我已经为此挣扎了好几天了。这是我的密码: <td align="left"> <table border="0" ce

我有一个表和一个搜索链接作为它的一列。当我单击搜索时,会弹出一个带有搜索框选项的ajax弹出扩展面板。搜索通过webservice调用完成,结果绑定在面板内的一个表中。我使表行可单击,并希望单击的行绑定到第一个表。我遇到的问题是跟踪每一行。当我单击面板中的一行时,第一个表中的所有行都被绑定,而不仅仅是那一行。我不知道如何跟踪我单击的行。非常感谢您的帮助,我已经为此挣扎了好几天了。这是我的密码:

  <td align="left">
  <table border="0" cellspacing="0" cellpadding="0">
      <th> Account </th>
      <th> Amount </th>
      <th> Reference </th>
      <th> Description </th>     
    <tbody databind="foreach: MyAccountModel.CurrentDisplayAccount()" >
    <td >
    <input  data-bind="text: $data.FormattedGLAccount" />
     </td>
     <td >
<input data-bind="text:$data.GLAccountDescription"/>
    </td>
    <td >
<input  data-bind="text:   $data.GLAccountTypeName" />
 </td>
  <td >
<input  data-bind="text:   $data.GLAccountLongDescription" />     </td>
  <td>
 <asp:HyperLink runat="server" ID="HyperLink1" NavigateUrl="javascript:$find('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />
       </td>
         </tbody>

     <--second row:-->
 <tr>
 <td >
<input  data-bind="text: $data.FormattedGLAccount" />    </td>
<td >
 <input  data-bind="text: $data.GLAccountDescription" />     </td>
 <td >
 <input  data-bind="text:   $data.GLAccountTypeName" />     </td>
 <td >
  <<input  data-bind="text:   $data.GLAccountLongDescription" />
 </td>
 <td >        
 <asp:HyperLink runat="server" ID="HyperLink2" NavigateUrl="javascript:$find  ('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />

                     </td>
                </tr>
            </table>
        </td>
JavaScript
$(文档).ready(函数(){
MyAccountModel=新AccountViewModel()
ko.应用绑定(MyAccountModel);
})
var传递模型;
var模型;
var AccountViewModel=函数(){
var self=这个;
self.model={};
self.invoice=ko.observearray([new invoice()]);
//对搜索帐户的Ajax调用(工作正常,绑定良好)
self.GetAccounts=函数(){
var searchstring=document.getElementById(“”)值;
var DTO={'searchstring':searchstring};
var AccountURL=“ajaxwebservicecalls.asmx/GetAccount”;
$.ajax({
类型:“Post”,
url:AccountURL,
数据:JSON.stringify(DTO),
contentType:“应用程序/json;字符集=utf-8”,
数据类型:“json”,
成功:函数添加(msg){
passedmodel=ko.mapping.fromJS(msg.d);
MyMasterviewModel.MyAccountModel.invoice(passedmodel);
},
错误:ONAccountFailure
});
}
函数ONAccountFailure(xhr,ex){
警报(xhr.responseText);
}
self.CurrentDisplayAccount=ko.observableArray([new CurrentDisplayAccount()]))
//这是为了在面板内选择一行
self.selectAccount=功能(项目){
self.CurrentDisplayAccount(项目);
};
HTML 为了节省空间,我不会显示弹出扩展程序/面板代码

帐户代码
描述
帐户类型
目的
现在,每当我单击上表的任何一行时,结果都会绑定到下表的两行。但是,我只希望它绑定到我单击搜索的行

  <td align="left">
  <table border="0" cellspacing="0" cellpadding="0">
      <th> Account </th>
      <th> Amount </th>
      <th> Reference </th>
      <th> Description </th>     
    <tbody databind="foreach: MyAccountModel.CurrentDisplayAccount()" >
    <td >
    <input  data-bind="text: $data.FormattedGLAccount" />
     </td>
     <td >
<input data-bind="text:$data.GLAccountDescription"/>
    </td>
    <td >
<input  data-bind="text:   $data.GLAccountTypeName" />
 </td>
  <td >
<input  data-bind="text:   $data.GLAccountLongDescription" />     </td>
  <td>
 <asp:HyperLink runat="server" ID="HyperLink1" NavigateUrl="javascript:$find('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />
       </td>
         </tbody>

     <--second row:-->
 <tr>
 <td >
<input  data-bind="text: $data.FormattedGLAccount" />    </td>
<td >
 <input  data-bind="text: $data.GLAccountDescription" />     </td>
 <td >
 <input  data-bind="text:   $data.GLAccountTypeName" />     </td>
 <td >
  <<input  data-bind="text:   $data.GLAccountLongDescription" />
 </td>
 <td >        
 <asp:HyperLink runat="server" ID="HyperLink2" NavigateUrl="javascript:$find  ('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />

                     </td>
                </tr>
            </table>
        </td>

账户
数量
参考文献
描述
. 
我希望能够单击第一个表中的任何一行,并且该行应绑定到第二个表。如果单击第一个表中的其他行,则该行应绑定到第二个表的第二行。希望这有意义

  <td align="left">
  <table border="0" cellspacing="0" cellpadding="0">
      <th> Account </th>
      <th> Amount </th>
      <th> Reference </th>
      <th> Description </th>     
    <tbody databind="foreach: MyAccountModel.CurrentDisplayAccount()" >
    <td >
    <input  data-bind="text: $data.FormattedGLAccount" />
     </td>
     <td >
<input data-bind="text:$data.GLAccountDescription"/>
    </td>
    <td >
<input  data-bind="text:   $data.GLAccountTypeName" />
 </td>
  <td >
<input  data-bind="text:   $data.GLAccountLongDescription" />     </td>
  <td>
 <asp:HyperLink runat="server" ID="HyperLink1" NavigateUrl="javascript:$find('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />
       </td>
         </tbody>

     <--second row:-->
 <tr>
 <td >
<input  data-bind="text: $data.FormattedGLAccount" />    </td>
<td >
 <input  data-bind="text: $data.GLAccountDescription" />     </td>
 <td >
 <input  data-bind="text:   $data.GLAccountTypeName" />     </td>
 <td >
  <<input  data-bind="text:   $data.GLAccountLongDescription" />
 </td>
 <td >        
 <asp:HyperLink runat="server" ID="HyperLink2" NavigateUrl="javascript:$find  ('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />

                     </td>
                </tr>
            </table>
        </td>

我真的需要一些帮助!

对您的问题的描述不是很清楚。您的更新有帮助,但我很难确定您想要完成什么

  <td align="left">
  <table border="0" cellspacing="0" cellpadding="0">
      <th> Account </th>
      <th> Amount </th>
      <th> Reference </th>
      <th> Description </th>     
    <tbody databind="foreach: MyAccountModel.CurrentDisplayAccount()" >
    <td >
    <input  data-bind="text: $data.FormattedGLAccount" />
     </td>
     <td >
<input data-bind="text:$data.GLAccountDescription"/>
    </td>
    <td >
<input  data-bind="text:   $data.GLAccountTypeName" />
 </td>
  <td >
<input  data-bind="text:   $data.GLAccountLongDescription" />     </td>
  <td>
 <asp:HyperLink runat="server" ID="HyperLink1" NavigateUrl="javascript:$find('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />
       </td>
         </tbody>

     <--second row:-->
 <tr>
 <td >
<input  data-bind="text: $data.FormattedGLAccount" />    </td>
<td >
 <input  data-bind="text: $data.GLAccountDescription" />     </td>
 <td >
 <input  data-bind="text:   $data.GLAccountTypeName" />     </td>
 <td >
  <<input  data-bind="text:   $data.GLAccountLongDescription" />
 </td>
 <td >        
 <asp:HyperLink runat="server" ID="HyperLink2" NavigateUrl="javascript:$find  ('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />

                     </td>
                </tr>
            </table>
        </td>

你会只显示两行吗?如果是这样,你需要在两个观察中跟踪每个选择

  <td align="left">
  <table border="0" cellspacing="0" cellpadding="0">
      <th> Account </th>
      <th> Amount </th>
      <th> Reference </th>
      <th> Description </th>     
    <tbody databind="foreach: MyAccountModel.CurrentDisplayAccount()" >
    <td >
    <input  data-bind="text: $data.FormattedGLAccount" />
     </td>
     <td >
<input data-bind="text:$data.GLAccountDescription"/>
    </td>
    <td >
<input  data-bind="text:   $data.GLAccountTypeName" />
 </td>
  <td >
<input  data-bind="text:   $data.GLAccountLongDescription" />     </td>
  <td>
 <asp:HyperLink runat="server" ID="HyperLink1" NavigateUrl="javascript:$find('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />
       </td>
         </tbody>

     <--second row:-->
 <tr>
 <td >
<input  data-bind="text: $data.FormattedGLAccount" />    </td>
<td >
 <input  data-bind="text: $data.GLAccountDescription" />     </td>
 <td >
 <input  data-bind="text:   $data.GLAccountTypeName" />     </td>
 <td >
  <<input  data-bind="text:   $data.GLAccountLongDescription" />
 </td>
 <td >        
 <asp:HyperLink runat="server" ID="HyperLink2" NavigateUrl="javascript:$find  ('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />

                     </td>
                </tr>
            </table>
        </td>
标记:

  <td align="left">
  <table border="0" cellspacing="0" cellpadding="0">
      <th> Account </th>
      <th> Amount </th>
      <th> Reference </th>
      <th> Description </th>     
    <tbody databind="foreach: MyAccountModel.CurrentDisplayAccount()" >
    <td >
    <input  data-bind="text: $data.FormattedGLAccount" />
     </td>
     <td >
<input data-bind="text:$data.GLAccountDescription"/>
    </td>
    <td >
<input  data-bind="text:   $data.GLAccountTypeName" />
 </td>
  <td >
<input  data-bind="text:   $data.GLAccountLongDescription" />     </td>
  <td>
 <asp:HyperLink runat="server" ID="HyperLink1" NavigateUrl="javascript:$find('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />
       </td>
         </tbody>

     <--second row:-->
 <tr>
 <td >
<input  data-bind="text: $data.FormattedGLAccount" />    </td>
<td >
 <input  data-bind="text: $data.GLAccountDescription" />     </td>
 <td >
 <input  data-bind="text:   $data.GLAccountTypeName" />     </td>
 <td >
  <<input  data-bind="text:   $data.GLAccountLongDescription" />
 </td>
 <td >        
 <asp:HyperLink runat="server" ID="HyperLink2" NavigateUrl="javascript:$find  ('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />

                     </td>
                </tr>
            </table>
        </td>
<tbody>
    <tr data-bind="with: CurrentDisplayAccount1">
        <td>
            <input data-bind="value: FormattedGLAccount" />
        </td>
        <td>
            <input data-bind="value: GLAccountDescription" />
        </td>
        <td style="padding-left: 4px; padding-right: 2px;"> <a href="#" onclick="javascript:$find('ModalPopupExtenderaccountsearchbehav').show();">Search</a>

        </td>
    </tr>
    <tr data-bind="with: CurrentDisplayAccount2">
        <td>
            <input data-bind="value: FormattedGLAccount" />
        </td>
        <td>
            <input data-bind="value: GLAccountDescription" />
        </td>
        <td style="padding-left: 4px; padding-right: 2px;"> <a href="#" onclick="javascript:$find('ModalPopupExtenderaccountsearchbehav').show();">Search</a>

        </td>
    </tr>
</tbody>
<tbody data-bind="foreach: CurrentDisplayAccount">
    <tr>
        <td>
            <input data-bind="value: FormattedGLAccount" />
        </td>
        <td>
            <input data-bind="value: GLAccountDescription" />
        </td>
        <td style="padding-left: 4px; padding-right: 2px;"> <a href="#" onclick="javascript:$find('ModalPopupExtenderaccountsearchbehav').show();">Search</a>

        </td>
    </tr>
这是你的小提琴的工作方式:

  <td align="left">
  <table border="0" cellspacing="0" cellpadding="0">
      <th> Account </th>
      <th> Amount </th>
      <th> Reference </th>
      <th> Description </th>     
    <tbody databind="foreach: MyAccountModel.CurrentDisplayAccount()" >
    <td >
    <input  data-bind="text: $data.FormattedGLAccount" />
     </td>
     <td >
<input data-bind="text:$data.GLAccountDescription"/>
    </td>
    <td >
<input  data-bind="text:   $data.GLAccountTypeName" />
 </td>
  <td >
<input  data-bind="text:   $data.GLAccountLongDescription" />     </td>
  <td>
 <asp:HyperLink runat="server" ID="HyperLink1" NavigateUrl="javascript:$find('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />
       </td>
         </tbody>

     <--second row:-->
 <tr>
 <td >
<input  data-bind="text: $data.FormattedGLAccount" />    </td>
<td >
 <input  data-bind="text: $data.GLAccountDescription" />     </td>
 <td >
 <input  data-bind="text:   $data.GLAccountTypeName" />     </td>
 <td >
  <<input  data-bind="text:   $data.GLAccountLongDescription" />
 </td>
 <td >        
 <asp:HyperLink runat="server" ID="HyperLink2" NavigateUrl="javascript:$find  ('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />

                     </td>
                </tr>
            </table>
        </td>

或者,是否希望将选定的每一行添加到表中而不受限制?在这种情况下,CurrentDisplayAccount需要是一个可观察的数组,而您的第二个表需要使用foreach绑定。单击某一行时,该行将添加到CurrentDisplayAccount数组中。如果希望第二个表不允许重复,则只需在添加它之前在数组中选中它

  <td align="left">
  <table border="0" cellspacing="0" cellpadding="0">
      <th> Account </th>
      <th> Amount </th>
      <th> Reference </th>
      <th> Description </th>     
    <tbody databind="foreach: MyAccountModel.CurrentDisplayAccount()" >
    <td >
    <input  data-bind="text: $data.FormattedGLAccount" />
     </td>
     <td >
<input data-bind="text:$data.GLAccountDescription"/>
    </td>
    <td >
<input  data-bind="text:   $data.GLAccountTypeName" />
 </td>
  <td >
<input  data-bind="text:   $data.GLAccountLongDescription" />     </td>
  <td>
 <asp:HyperLink runat="server" ID="HyperLink1" NavigateUrl="javascript:$find('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />
       </td>
         </tbody>

     <--second row:-->
 <tr>
 <td >
<input  data-bind="text: $data.FormattedGLAccount" />    </td>
<td >
 <input  data-bind="text: $data.GLAccountDescription" />     </td>
 <td >
 <input  data-bind="text:   $data.GLAccountTypeName" />     </td>
 <td >
  <<input  data-bind="text:   $data.GLAccountLongDescription" />
 </td>
 <td >        
 <asp:HyperLink runat="server" ID="HyperLink2" NavigateUrl="javascript:$find  ('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />

                     </td>
                </tr>
            </table>
        </td>
标记:

  <td align="left">
  <table border="0" cellspacing="0" cellpadding="0">
      <th> Account </th>
      <th> Amount </th>
      <th> Reference </th>
      <th> Description </th>     
    <tbody databind="foreach: MyAccountModel.CurrentDisplayAccount()" >
    <td >
    <input  data-bind="text: $data.FormattedGLAccount" />
     </td>
     <td >
<input data-bind="text:$data.GLAccountDescription"/>
    </td>
    <td >
<input  data-bind="text:   $data.GLAccountTypeName" />
 </td>
  <td >
<input  data-bind="text:   $data.GLAccountLongDescription" />     </td>
  <td>
 <asp:HyperLink runat="server" ID="HyperLink1" NavigateUrl="javascript:$find('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />
       </td>
         </tbody>

     <--second row:-->
 <tr>
 <td >
<input  data-bind="text: $data.FormattedGLAccount" />    </td>
<td >
 <input  data-bind="text: $data.GLAccountDescription" />     </td>
 <td >
 <input  data-bind="text:   $data.GLAccountTypeName" />     </td>
 <td >
  <<input  data-bind="text:   $data.GLAccountLongDescription" />
 </td>
 <td >        
 <asp:HyperLink runat="server" ID="HyperLink2" NavigateUrl="javascript:$find  ('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />

                     </td>
                </tr>
            </table>
        </td>
<tbody>
    <tr data-bind="with: CurrentDisplayAccount1">
        <td>
            <input data-bind="value: FormattedGLAccount" />
        </td>
        <td>
            <input data-bind="value: GLAccountDescription" />
        </td>
        <td style="padding-left: 4px; padding-right: 2px;"> <a href="#" onclick="javascript:$find('ModalPopupExtenderaccountsearchbehav').show();">Search</a>

        </td>
    </tr>
    <tr data-bind="with: CurrentDisplayAccount2">
        <td>
            <input data-bind="value: FormattedGLAccount" />
        </td>
        <td>
            <input data-bind="value: GLAccountDescription" />
        </td>
        <td style="padding-left: 4px; padding-right: 2px;"> <a href="#" onclick="javascript:$find('ModalPopupExtenderaccountsearchbehav').show();">Search</a>

        </td>
    </tr>
</tbody>
<tbody data-bind="foreach: CurrentDisplayAccount">
    <tr>
        <td>
            <input data-bind="value: FormattedGLAccount" />
        </td>
        <td>
            <input data-bind="value: GLAccountDescription" />
        </td>
        <td style="padding-left: 4px; padding-right: 2px;"> <a href="#" onclick="javascript:$find('ModalPopupExtenderaccountsearchbehav').show();">Search</a>

        </td>
    </tr>
这是你的小提琴以这种方式演奏(减去重复的支票):

  <td align="left">
  <table border="0" cellspacing="0" cellpadding="0">
      <th> Account </th>
      <th> Amount </th>
      <th> Reference </th>
      <th> Description </th>     
    <tbody databind="foreach: MyAccountModel.CurrentDisplayAccount()" >
    <td >
    <input  data-bind="text: $data.FormattedGLAccount" />
     </td>
     <td >
<input data-bind="text:$data.GLAccountDescription"/>
    </td>
    <td >
<input  data-bind="text:   $data.GLAccountTypeName" />
 </td>
  <td >
<input  data-bind="text:   $data.GLAccountLongDescription" />     </td>
  <td>
 <asp:HyperLink runat="server" ID="HyperLink1" NavigateUrl="javascript:$find('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />
       </td>
         </tbody>

     <--second row:-->
 <tr>
 <td >
<input  data-bind="text: $data.FormattedGLAccount" />    </td>
<td >
 <input  data-bind="text: $data.GLAccountDescription" />     </td>
 <td >
 <input  data-bind="text:   $data.GLAccountTypeName" />     </td>
 <td >
  <<input  data-bind="text:   $data.GLAccountLongDescription" />
 </td>
 <td >        
 <asp:HyperLink runat="server" ID="HyperLink2" NavigateUrl="javascript:$find  ('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />

                     </td>
                </tr>
            </table>
        </td>

希望这些示例能够帮助您摆脱困境。

对您的问题的描述不是很清楚。您的更新会有所帮助,但我很难确定您想要完成什么

  <td align="left">
  <table border="0" cellspacing="0" cellpadding="0">
      <th> Account </th>
      <th> Amount </th>
      <th> Reference </th>
      <th> Description </th>     
    <tbody databind="foreach: MyAccountModel.CurrentDisplayAccount()" >
    <td >
    <input  data-bind="text: $data.FormattedGLAccount" />
     </td>
     <td >
<input data-bind="text:$data.GLAccountDescription"/>
    </td>
    <td >
<input  data-bind="text:   $data.GLAccountTypeName" />
 </td>
  <td >
<input  data-bind="text:   $data.GLAccountLongDescription" />     </td>
  <td>
 <asp:HyperLink runat="server" ID="HyperLink1" NavigateUrl="javascript:$find('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />
       </td>
         </tbody>

     <--second row:-->
 <tr>
 <td >
<input  data-bind="text: $data.FormattedGLAccount" />    </td>
<td >
 <input  data-bind="text: $data.GLAccountDescription" />     </td>
 <td >
 <input  data-bind="text:   $data.GLAccountTypeName" />     </td>
 <td >
  <<input  data-bind="text:   $data.GLAccountLongDescription" />
 </td>
 <td >        
 <asp:HyperLink runat="server" ID="HyperLink2" NavigateUrl="javascript:$find  ('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />

                     </td>
                </tr>
            </table>
        </td>

你会只显示两行吗?如果是这样,你需要在两个观察中跟踪每个选择

  <td align="left">
  <table border="0" cellspacing="0" cellpadding="0">
      <th> Account </th>
      <th> Amount </th>
      <th> Reference </th>
      <th> Description </th>     
    <tbody databind="foreach: MyAccountModel.CurrentDisplayAccount()" >
    <td >
    <input  data-bind="text: $data.FormattedGLAccount" />
     </td>
     <td >
<input data-bind="text:$data.GLAccountDescription"/>
    </td>
    <td >
<input  data-bind="text:   $data.GLAccountTypeName" />
 </td>
  <td >
<input  data-bind="text:   $data.GLAccountLongDescription" />     </td>
  <td>
 <asp:HyperLink runat="server" ID="HyperLink1" NavigateUrl="javascript:$find('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />
       </td>
         </tbody>

     <--second row:-->
 <tr>
 <td >
<input  data-bind="text: $data.FormattedGLAccount" />    </td>
<td >
 <input  data-bind="text: $data.GLAccountDescription" />     </td>
 <td >
 <input  data-bind="text:   $data.GLAccountTypeName" />     </td>
 <td >
  <<input  data-bind="text:   $data.GLAccountLongDescription" />
 </td>
 <td >        
 <asp:HyperLink runat="server" ID="HyperLink2" NavigateUrl="javascript:$find  ('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />

                     </td>
                </tr>
            </table>
        </td>
标记:

  <td align="left">
  <table border="0" cellspacing="0" cellpadding="0">
      <th> Account </th>
      <th> Amount </th>
      <th> Reference </th>
      <th> Description </th>     
    <tbody databind="foreach: MyAccountModel.CurrentDisplayAccount()" >
    <td >
    <input  data-bind="text: $data.FormattedGLAccount" />
     </td>
     <td >
<input data-bind="text:$data.GLAccountDescription"/>
    </td>
    <td >
<input  data-bind="text:   $data.GLAccountTypeName" />
 </td>
  <td >
<input  data-bind="text:   $data.GLAccountLongDescription" />     </td>
  <td>
 <asp:HyperLink runat="server" ID="HyperLink1" NavigateUrl="javascript:$find('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />
       </td>
         </tbody>

     <--second row:-->
 <tr>
 <td >
<input  data-bind="text: $data.FormattedGLAccount" />    </td>
<td >
 <input  data-bind="text: $data.GLAccountDescription" />     </td>
 <td >
 <input  data-bind="text:   $data.GLAccountTypeName" />     </td>
 <td >
  <<input  data-bind="text:   $data.GLAccountLongDescription" />
 </td>
 <td >        
 <asp:HyperLink runat="server" ID="HyperLink2" NavigateUrl="javascript:$find  ('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />

                     </td>
                </tr>
            </table>
        </td>
<tbody>
    <tr data-bind="with: CurrentDisplayAccount1">
        <td>
            <input data-bind="value: FormattedGLAccount" />
        </td>
        <td>
            <input data-bind="value: GLAccountDescription" />
        </td>
        <td style="padding-left: 4px; padding-right: 2px;"> <a href="#" onclick="javascript:$find('ModalPopupExtenderaccountsearchbehav').show();">Search</a>

        </td>
    </tr>
    <tr data-bind="with: CurrentDisplayAccount2">
        <td>
            <input data-bind="value: FormattedGLAccount" />
        </td>
        <td>
            <input data-bind="value: GLAccountDescription" />
        </td>
        <td style="padding-left: 4px; padding-right: 2px;"> <a href="#" onclick="javascript:$find('ModalPopupExtenderaccountsearchbehav').show();">Search</a>

        </td>
    </tr>
</tbody>
<tbody data-bind="foreach: CurrentDisplayAccount">
    <tr>
        <td>
            <input data-bind="value: FormattedGLAccount" />
        </td>
        <td>
            <input data-bind="value: GLAccountDescription" />
        </td>
        <td style="padding-left: 4px; padding-right: 2px;"> <a href="#" onclick="javascript:$find('ModalPopupExtenderaccountsearchbehav').show();">Search</a>

        </td>
    </tr>
这是你的小提琴的工作方式:

  <td align="left">
  <table border="0" cellspacing="0" cellpadding="0">
      <th> Account </th>
      <th> Amount </th>
      <th> Reference </th>
      <th> Description </th>     
    <tbody databind="foreach: MyAccountModel.CurrentDisplayAccount()" >
    <td >
    <input  data-bind="text: $data.FormattedGLAccount" />
     </td>
     <td >
<input data-bind="text:$data.GLAccountDescription"/>
    </td>
    <td >
<input  data-bind="text:   $data.GLAccountTypeName" />
 </td>
  <td >
<input  data-bind="text:   $data.GLAccountLongDescription" />     </td>
  <td>
 <asp:HyperLink runat="server" ID="HyperLink1" NavigateUrl="javascript:$find('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />
       </td>
         </tbody>

     <--second row:-->
 <tr>
 <td >
<input  data-bind="text: $data.FormattedGLAccount" />    </td>
<td >
 <input  data-bind="text: $data.GLAccountDescription" />     </td>
 <td >
 <input  data-bind="text:   $data.GLAccountTypeName" />     </td>
 <td >
  <<input  data-bind="text:   $data.GLAccountLongDescription" />
 </td>
 <td >        
 <asp:HyperLink runat="server" ID="HyperLink2" NavigateUrl="javascript:$find  ('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />

                     </td>
                </tr>
            </table>
        </td>

或者,是否希望将选定的每一行添加到表中而不受限制?在这种情况下,CurrentDisplayAccount需要是一个可观察的数组,而您的第二个表需要使用foreach绑定。单击某一行时,该行将添加到CurrentDisplayAccount数组中。如果希望第二个表不允许重复,则只需在添加它之前在数组中选中它

  <td align="left">
  <table border="0" cellspacing="0" cellpadding="0">
      <th> Account </th>
      <th> Amount </th>
      <th> Reference </th>
      <th> Description </th>     
    <tbody databind="foreach: MyAccountModel.CurrentDisplayAccount()" >
    <td >
    <input  data-bind="text: $data.FormattedGLAccount" />
     </td>
     <td >
<input data-bind="text:$data.GLAccountDescription"/>
    </td>
    <td >
<input  data-bind="text:   $data.GLAccountTypeName" />
 </td>
  <td >
<input  data-bind="text:   $data.GLAccountLongDescription" />     </td>
  <td>
 <asp:HyperLink runat="server" ID="HyperLink1" NavigateUrl="javascript:$find('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />
       </td>
         </tbody>

     <--second row:-->
 <tr>
 <td >
<input  data-bind="text: $data.FormattedGLAccount" />    </td>
<td >
 <input  data-bind="text: $data.GLAccountDescription" />     </td>
 <td >
 <input  data-bind="text:   $data.GLAccountTypeName" />     </td>
 <td >
  <<input  data-bind="text:   $data.GLAccountLongDescription" />
 </td>
 <td >        
 <asp:HyperLink runat="server" ID="HyperLink2" NavigateUrl="javascript:$find  ('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />

                     </td>
                </tr>
            </table>
        </td>
标记:

  <td align="left">
  <table border="0" cellspacing="0" cellpadding="0">
      <th> Account </th>
      <th> Amount </th>
      <th> Reference </th>
      <th> Description </th>     
    <tbody databind="foreach: MyAccountModel.CurrentDisplayAccount()" >
    <td >
    <input  data-bind="text: $data.FormattedGLAccount" />
     </td>
     <td >
<input data-bind="text:$data.GLAccountDescription"/>
    </td>
    <td >
<input  data-bind="text:   $data.GLAccountTypeName" />
 </td>
  <td >
<input  data-bind="text:   $data.GLAccountLongDescription" />     </td>
  <td>
 <asp:HyperLink runat="server" ID="HyperLink1" NavigateUrl="javascript:$find('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />
       </td>
         </tbody>

     <--second row:-->
 <tr>
 <td >
<input  data-bind="text: $data.FormattedGLAccount" />    </td>
<td >
 <input  data-bind="text: $data.GLAccountDescription" />     </td>
 <td >
 <input  data-bind="text:   $data.GLAccountTypeName" />     </td>
 <td >
  <<input  data-bind="text:   $data.GLAccountLongDescription" />
 </td>
 <td >        
 <asp:HyperLink runat="server" ID="HyperLink2" NavigateUrl="javascript:$find  ('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />

                     </td>
                </tr>
            </table>
        </td>
<tbody>
    <tr data-bind="with: CurrentDisplayAccount1">
        <td>
            <input data-bind="value: FormattedGLAccount" />
        </td>
        <td>
            <input data-bind="value: GLAccountDescription" />
        </td>
        <td style="padding-left: 4px; padding-right: 2px;"> <a href="#" onclick="javascript:$find('ModalPopupExtenderaccountsearchbehav').show();">Search</a>

        </td>
    </tr>
    <tr data-bind="with: CurrentDisplayAccount2">
        <td>
            <input data-bind="value: FormattedGLAccount" />
        </td>
        <td>
            <input data-bind="value: GLAccountDescription" />
        </td>
        <td style="padding-left: 4px; padding-right: 2px;"> <a href="#" onclick="javascript:$find('ModalPopupExtenderaccountsearchbehav').show();">Search</a>

        </td>
    </tr>
</tbody>
<tbody data-bind="foreach: CurrentDisplayAccount">
    <tr>
        <td>
            <input data-bind="value: FormattedGLAccount" />
        </td>
        <td>
            <input data-bind="value: GLAccountDescription" />
        </td>
        <td style="padding-left: 4px; padding-right: 2px;"> <a href="#" onclick="javascript:$find('ModalPopupExtenderaccountsearchbehav').show();">Search</a>

        </td>
    </tr>
这是你的小提琴以这种方式演奏(减去重复的支票):

  <td align="left">
  <table border="0" cellspacing="0" cellpadding="0">
      <th> Account </th>
      <th> Amount </th>
      <th> Reference </th>
      <th> Description </th>     
    <tbody databind="foreach: MyAccountModel.CurrentDisplayAccount()" >
    <td >
    <input  data-bind="text: $data.FormattedGLAccount" />
     </td>
     <td >
<input data-bind="text:$data.GLAccountDescription"/>
    </td>
    <td >
<input  data-bind="text:   $data.GLAccountTypeName" />
 </td>
  <td >
<input  data-bind="text:   $data.GLAccountLongDescription" />     </td>
  <td>
 <asp:HyperLink runat="server" ID="HyperLink1" NavigateUrl="javascript:$find('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />
       </td>
         </tbody>

     <--second row:-->
 <tr>
 <td >
<input  data-bind="text: $data.FormattedGLAccount" />    </td>
<td >
 <input  data-bind="text: $data.GLAccountDescription" />     </td>
 <td >
 <input  data-bind="text:   $data.GLAccountTypeName" />     </td>
 <td >
  <<input  data-bind="text:   $data.GLAccountLongDescription" />
 </td>
 <td >        
 <asp:HyperLink runat="server" ID="HyperLink2" NavigateUrl="javascript:$find  ('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />

                     </td>
                </tr>
            </table>
        </td>

希望这些示例能够帮助您摆脱困境。

Wow man非常感谢!!我现在看到我遗漏了什么。为了明确我想要做什么,我希望最初在屏幕上显示10行。记住,我从中选择的表位于模式扩展面板内。我将在这10行中的每行中都有一个搜索链接,并且每行都可以打开e面板。然后在面板内部是可单击的行。当我第一次单击一行时,它会绑定回屏幕上的表。等等。但这只是另一个问题。因此,如果我想先显示10行,然后能够动态添加更多行,最好的方法是什么?另外,如果在单击一行并获得值后,我ant是否要更改该值?这意味着我要再次搜索同一行并单击不同的值?再次感谢。在第一部分中,您可以从服务器获取所有行并将它们存储在
  <td align="left">
  <table border="0" cellspacing="0" cellpadding="0">
      <th> Account </th>
      <th> Amount </th>
      <th> Reference </th>
      <th> Description </th>     
    <tbody databind="foreach: MyAccountModel.CurrentDisplayAccount()" >
    <td >
    <input  data-bind="text: $data.FormattedGLAccount" />
     </td>
     <td >
<input data-bind="text:$data.GLAccountDescription"/>
    </td>
    <td >
<input  data-bind="text:   $data.GLAccountTypeName" />
 </td>
  <td >
<input  data-bind="text:   $data.GLAccountLongDescription" />     </td>
  <td>
 <asp:HyperLink runat="server" ID="HyperLink1" NavigateUrl="javascript:$find('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />
       </td>
         </tbody>

     <--second row:-->
 <tr>
 <td >
<input  data-bind="text: $data.FormattedGLAccount" />    </td>
<td >
 <input  data-bind="text: $data.GLAccountDescription" />     </td>
 <td >
 <input  data-bind="text:   $data.GLAccountTypeName" />     </td>
 <td >
  <<input  data-bind="text:   $data.GLAccountLongDescription" />
 </td>
 <td >        
 <asp:HyperLink runat="server" ID="HyperLink2" NavigateUrl="javascript:$find  ('ModalPopupExtenderaccountsearchbehav').show();" Text="Search"  />

                     </td>
                </tr>
            </table>
        </td>