2017-08-03 3 views
0

私はhandsontableから値を取得したいが、私はこのエラーを取得しています得ていない: キャッチされないにReferenceError:ホットはがhandsonテーブルからデータ

が定義されていない、私が持っているように私はこのエラーを取得していますなぜ私は知りません定義された熱い。ここ

は私のJSコード

<body> 
    <div id='table_set' style='margin-left:150px;'> 

     <button id='save'>Save</button> 


     <div class='handsontable' id='create_table'></div> 
     </div> 
    </body> 

    <script> 
    $(document).ready(function() { 
      var data = [[]]; 
      var container = document.getElementById('create_table'); 
      var hot = new Handsontable(container, 
      { 
      data: data, 
      minRows: 30, 
      minCols: 13, 
      maxRows:100, 
      copyPaste:true, 
      colHeaders: true, 
      rowHeaders: true, 
      rowHeaders: true, 
      contextMenu: true, 
      dropdown: true, 
      colHeaders:["Testcase Name","Cell Name","Customer","Flops","Title","Status","Mfix CCR(open/close)","Scenerio-Brief Description","Expected Results","CCR Status","CCR No.","Remarks","Testcase Path"] 
     }); 
    }); 

    $(document).ready(function() { 
     $('#save').click(function() { 
     var pr= hot.getData(); 
     alert(pr); 
    }); 
    }); 

である私は私が行方不明です保存button.Pleaseヘルプを、打つたび警告ボックスに、私はテーブルに書かれている値を取得したいです。

ありがとうございます。

答えて

0

あなたのエラー私は1 document.readyで宣言された変数が

他にアクセスすることはできないと思うおそらく複数 document.ready機能 であるが、一般的に、あなたが参照して、単一の document.ready

でこれらを達成することができますdocument.ready mulitple使用していけない:Can you have multiple $(document).ready(function(){ ... }); sections?

ハンドソンテーブル参照:http://jsfiddle.net/yk64yv8q/4/

関連する問題