1

テーブルでhttp://mottie.github.comの jquery プラグイン tablesort を使用しています。起こることを意味するのは

  • ヘッダーセルをクリックします
  • jquery uiダイアログは、読み込み中と言っています
  • ユーザー入力によってデータが変更されると、更新イベントを使用してテーブルキャッシュが更新されます
  • ソートが発生します
  • 次に、ダイアログが削除されます

問題は、ダイアログが常に開いていないか、閉じないことです。イベント sortStart と sortEnd でダイアログを開くと、2 回開いて閉じますが、更新イベントが完了するまで開くのを待ちます。

アラートを使用するとうまく機能しますが、それは私が望むものではありません。ダイアログが必要です。

botton line is I need to use the update event and a dialog..... can yo please help.. my concept code is below.. Thanks

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="js/jquery-1.8.2.min.js"></script>
    <script src="js/jquery.tablesorter.min.js"></script>
    <link href="css/smoothness/jquery-ui-1.9.1.custom.min.css" rel="stylesheet" />
    <script src="js/jquery-ui-1.9.1.custom.min.js"></script>



    <script type="text/javascript">

        $(function () {
            //add table sort
            $("#myTable").tablesorter();


            // bind to sort events begin
            $("#myTable").bind("sortBegin", function (e, table) {

                $('<div id="myDialog">loading</div>').dialog();

                $("#myTable").trigger("update"); // update table cache
                //alert('open');
            })

            $("#myTable").bind("updateComplete", function (e, table) {
                //alert("updateComplete")
            });

            $("#myTable").bind("sortStart", function (e, table) {
                //alert("sortStart")
            });

            $("#myTable").bind("sortEnd", function (e, table) {
                //alert("sortEnd")
                $('#myDialog').dialog("close");

            });



        });


    </script>




</head>
<body>
    <form id="form1" runat="server">
    <div>


        <table id="myTable" class="tablesorter"> 
  <thead> 
    <tr> 
      <th>Last Name</th> 
      <th>First Name</th> 
      <th>Email</th> 
      <th>Due</th> 
      <th>Web Site</th> 
    </tr> 
  </thead> 
  <tbody> 

    <tr> 
      <td>Smith</td> 
      <td>John</td> 


         <td>jsmith@gmail.com</td> 
          <td>$50.00</td> 
          <td>http://www.jsmith.com</td> 
        </tr> 

<!-- this is here to simulate loads of extra rows -->
          <% For index = 1 To 100

                  Response.Write("<tr><td>Doe</td><td>Jason</td><td>jdoe@hotmail.com</td><td>$100.00</td><td>http://www.jdoe.com</td></tr> ")

              Next
              %>

        <tr> 
          <td>Conway</td> 
      <td>Tim</td> 
      <td>tconway@earthlink.net</td> 
      <td>$50.00</td> 
      <td>http://www.timconway.com</td> 
    </tr> 
  </tbody> 
</table>


    </div>
    </form>
</body>
</html>
4

0 に答える 0