Pregunta

I followed the steps suggested by User: PostureOfLearning and came up with a test code , which i Pasted below. It is working fine in Chrome, but not in IE.Please let me know, if i need to make any changes to make the code work in IE.Thanks in advance.

 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>  
 <script src="jquery.js" type="text/javascript"></script>  
 <script src="jquery.plugin.js" type="text/javascript"></script>  
 <script src="custom.js" type="text/javascript"></script> 
 <script src="C:\wamp\www\rrr\bin\jquery-handsontable-master\dist_wc\x-handsontable\jquery.handsontable.full.js"></script>
 <link rel="stylesheet" media="screen" href="C:\wamp\www\rrr\bin\jquery-handsontable-master\dist_wc\x-handsontable\jquery.handsontable.full.css">
 </head>
 <body>
 <div id="handsontableDivID">
 <script>
  var data = [
   ["", "Maserati", "Mazda", "Mercedes", "Mini", "Mitsubishi"],
   ["2009", 0, 2941, 4303, 354, 5814],
   ["2010", 5, 2905, 2867, 412, 5284],
   ["2011", 4, 2517, 4822, 552, 6127],
   ["2012", 2, 2422, 5399, 776, 4151]
             ];
  var config = {
    data: data,
    minRows: 5,
    minCols: 6,
    minSpareRows: 1,
    autoWrapRow: true,
    colHeaders: true,
    contextMenu: true
    };
    $("#handsontableDivID").handsontable(config);
   </script>
   </body>
   </html>

The errors i am getting are SCRIPT1014: Invalid character jquery.handsontable.full.js, line 1 character 1 SCRIPT438: Object doesn't support property or method 'handsontable' test1.html, line 32 character 1

¿Fue útil?

Solución

I'm assuming you extracted the zip file into your web site solution and that you also have jQuery installed.

On the web pages, you will need to make sure you add the script pointing to the js file you extracted. Something like:

<script src="~/js/Handsontable/jquery.handsontable.js"></script>

And add styling:

<link href="~/css/jquery.handsontable.css" rel="stylesheet" />

And some sample js:

var config = {} //Any config would be done here
$("#handsontableDivID").handsontable(config); //this initializes the table

To get the data out of handsontable and send back to server:

vara data = $("#handsontableDivID").handsontable('getInstance').getData();

Look through the examples and how to's:

http://handsontable.com/index.html

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top