码迷,mamicode.com
首页 > 其他好文 > 详细

handsontable-developer guide-setting options,callback

时间:2015-07-18 10:54:59      阅读:199      评论:0      收藏:0      [点我收藏+]

标签:

1、cell数组

cell: [
	{row: 0, col: 0, readOnly: true}
]

2、cells函数

cells: function(row, col, prop){
	var cellProperties = {};

	if(row === 0 && col === 0){
		cellProperties.readOnly = true;
	}

	return cellProperties;
}

3、串联设置:第一列可以编辑;第一列的第一行 和 其他 都是只读的。

readOnly: true,
columns: [
  {readOnly: false},
  {},
  {}
],
cells: function (row, col, prop) {
  var cellProperties = {}

  if (row === 0 && col === 0) {
    cellProperties.readOnly = true;
  }

  return cellProperties;
}

4、串联配置模型

//constructor
new Handsontable(document.getElementById(‘example‘), {
  option: ‘value‘
});
//columns
new Handsontable(document.getElementById(‘example‘), {
  columns: {
    option: ‘value‘
  }
});
//cells
new Handsontable(document.getElementById(‘example‘), {
  cells: function(row, col, prop) {

  }
});

  

回调函数好复杂:

Handsontable.hooks.getRegistered(): 返回所有注册的函数
给config加个变量就好,如果不知道callback的参数,console.log(arguments)就可以

 

handsontable-developer guide-setting options,callback

标签:

原文地址:http://www.cnblogs.com/wang-jing/p/4656310.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!