当我将数据解析为手持设备并单击按钮时。我要替换"A“栏中的所有行。将"A“列中的每一行更改为(101、102、103)后,将数据保存在其他列中。有人能帮我吗?谢谢。
$(document).ready(function () {
var data = [
["2008", 10, 11, 12, 13],
["2009", 20, 11, 14, 13],
["2010", 30, 15, 12, 13]
];
var $container = $("#example1");
$container.handsontable({
data: data,
startRows: 5,
startCols: 5,
colHeaders: true,
minSpareRows: 1
});
});</style><!-- Ugly Hack due to jsFiddle issue: http://goo.gl/BUfGZ -->
<script src="http://handsontable.com/lib/jquery.min.js"></script>
<script src="http://handsontable.com/dist/jquery.handsontable.full.js"></script>
<link rel="stylesheet" media="screen" href="http://handsontable.com/dist/jquery.handsontable.full.css">
<link rel="stylesheet" media="screen" href="http://handsontable.com/demo/css/samples.css?20140331">
<style type="text/css">
body {background: white; margin: 20px;}
h2 {margin: 20px 0;}<div class="handsontable" id="example1"></div>
<p>
<button name="dump" data-dump="#example1" title="Prints current data source to Firebug/Chrome Dev Tools">Dump
data to console
</button>
</p>
发布于 2014-11-06 11:32:41
添加以下代码:
var newData=[101,102,103];//your data
$.each(newData,function(i,v){
$('#example1').handsontable('setDataAtCell', i, 0, v);
})https://stackoverflow.com/questions/26774064
复制相似问题