OSDN Git Service

commit iepg adding on web function.
[rec10/rec10-git.git] / Rec10WEB / trunk / src / iepg_show.htm
index 71f27ca..cb71370 100644 (file)
@@ -1,12 +1,12 @@
 
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-    <meta http-equiv="Content-Style-Type" content="text/css">
-    <meta http-equiv="Content-Script-Type" content="text/javascript">
-    <title>Rec10 Simple Web Interface ver.0.7.0 iEPGデータ表示</title>
-    <script src="./dojo/dojo/dojo.js" djConfig="parseOnLoad:true">
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+        <meta http-equiv="Content-Style-Type" content="text/css">
+        <meta http-equiv="Content-Script-Type" content="text/javascript">
+        <title>Rec10 Simple Web Interface ver.0.7.0 iEPGデータ表示</title>
+        <script src="./dojo/dojo/dojo.js" djConfig="parseOnLoad:true">
         </script>
         <!-- テーマの読み込み -->
         <style type="text/css">
             dojo.require("dijit.form.Button");
             dojo.require("dijit.form.TextBox");
             dojo.require("dojo.data.ItemFileWriteStore");
-            dojo.require("dijit.form.ValidationTextBox");
             dojo.require("dojox.data.CsvStore");
             dojo.require("dijit.form.TextBox");
-            dojo.require("dojox.grid.cells.dijit")
+            dojo.require("dojox.grid.Selection");
             var iepgstore = new dojox.data.CsvStore({url:'./iepgdatum.csv'});
-            //var iepgStructure=[
-            //    {name:"ID",field:"id",width:"30px"},
-            //    {name:"チャンネル",field:"name",width:"200px"},
-            //    {name:"chtxt",field:"chtxt",width:"100px"}
-            //]
-            function changeGrid(grid){
-                var s=dijit.byId("iepgGrid").store.getValue(dijit.byId("iepgGrid").getItem(grid.rowIndex),"id");
-                var str=dijit.byId("iepg_delnum").value;
-                str=str+","+s;
-                dijit.byId("iepg_delnum").setValue(str);
-            };
-            dojo.addOnLoad(function(){
-                dojo.connect(dijit.byId("iepgGrid"),"onRowClick",changeGrid);
-                dojo.connect(dijit.byId("del"),"onClick",function(e){
-                    dijit.byId("MainForm").submit();
-                });
-            });
+            function click(){
+                var items=dijit.byId("iepgGrid").selection.getSelected();
+                var str="";
+                for (i=0;i<items.length;i++){
+                    var s=dijit.byId("iepgGrid").store.getValue(items[i],"id");
+                    str=str+s+",";
+                }
+                dijit.byId("iepgdelnum").setValue(str);
+            }
         </script>
-  </head>
-  <body class="tundra">
-    <div dojoType="dijit.form.Form" action="rec10web.py" onExecute="this.submit()" id="MainForm">
-        <h1>Rec10 Simple Web Interface ver.0.7.0 iEPGデータ表示</h1><br>
-        <table dojoType="dojox.grid.DataGrid"
-            id="iepgGrid"
-            jsid="iepgGrid"
-            store="iepgstore"
-            query="{id:'*'}"
-            autoHeight="true"
-            width="100%"
-            autoHeight="true"
-            autoWidth="true"
-            clientSort="true"
-            onRowClick="changeGrid"
-            >
-            <thead>
-                <tr>
-                    <th field="id" width="30px">ID</th>
-                    <th field="name" width="200px">チャンネル</th>
-                    <th field="chtxt" width="100px">chtxt</th>
-                </tr>
-            </thead>
-        </table>
+    </head>
+    <body class="tundra">
+        <div dojoType="dijit.form.Form" action="rec10web.py" onExecute="this.submit()">
+            <h1>Rec10 Simple Web Interface ver.0.7.0 iEPGデータ表示</h1><br>
+            <table dojoType="dojox.grid.DataGrid"
+                   id="iepgGrid"
+                   jsid="iepgGrid"
+                   store="iepgstore"
+                   query="{id:'*'}"
+                   autoHeight="true"
+                   width="100%"
+                   autoHeight="true"
+                   autoWidth="true"
+                   clientSort="true"
+                   onClick="click"
+                   >
+                <thead>
+                    <tr>
+                        <th field="id" width="30px">ID</th>
+                        <th field="name" width="200px">チャンネル</th>
+                        <th field="chtxt" width="100px">chtxt</th>
+                    </tr>
+                </thead>
+            </table>
+            <div dojoType="dijit.form.Button" type="submit">DEL</div>
+            <div name="exec"
+                 dojoType="dijit.form.TextBox"
+                 value="iepg-del"
+                 style="display:none">
+            </div>
+            <div dojoType="dijit.form.TextBox"
+                 name="iepgdelnum"
+                 id="iepgdelnum"
+                 value=""
+                 style="display:none">
+            </div>
         </div>
-        <div dojoType="dijit.form.Button" type="submit" id="del">DEL</div>
-        <div name="exec"
-             dojoType="dijit.form.ValidationTextBox"
-             value="iepg-del"
-             style="display:none">
-        </div>
-        <div name="iepg_delnum:"
-             id="iepg_delnum"
-             dojoType="dijit.form.TextBox"
-             value=""
-             style="display:none">
-        </div>
-    </div>
-  </body>
+    </body>
 </html>