handsontable-developer guide-setting options,callback

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)就可以
时间: 2024-10-06 00:23:12

handsontable-developer guide-setting options,callback的相关文章

Ehcache(2.9.x) - API Developer Guide, Cache Eviction Algorithms

About Cache Eviction Algorithms A cache eviction algorithm is a way of deciding which element to evict when the cache is full. In Ehcache , the memory store and the off-heap store might be limited in size. When these stores get full, elements are evi

Ehcache(2.9.x) - API Developer Guide, Write-Through and Write-Behind Caches

About Write-Through and Write-Behind Caches Write-through caching is a caching pattern where writes to the cache cause writes to an underlying resource. The cache acts as a facade to the underlying resource. With this pattern, it often makes sense to

Ehcache(2.9.x) - API Developer Guide, Cache Event Listeners

About Cache Event Listeners Cache listeners allow implementers to register callback methods that will be executed when a cache event occurs. Cache listeners implement the CacheEventListener interface. The events include: An Element has been put An El

Ehcache(2.9.x) - API Developer Guide, Cache Manager Event Listeners

About CacheManager Event Listeners CacheManager event listeners allow implementers to register callback methods that will be executed when a CacheManager event occurs. CacheManager listeners implement the CacheManagerEventListener interface. The even

Ehcache(2.9.x) - API Developer Guide, Key Classes and Methods

About the Key Classes Ehcache consists of a CacheManager, which manages logical data sets represented as Caches. A Cache object contains Elements, which are essentially name-value pairs. You can use Cache objects to hold any kind of data that you wan

Ehcache(2.9.x) - API Developer Guide, Class Loading

About Class Loading Class loading, within the plethora of environments that Ehcache can be running, could be complex. But with Ehcache, all class loading is done in a standard way in one utility class: ClassLoaderUtil. Plugin Class Loading Ehcache al

Ehcache(2.9.x) - API Developer Guide, Cache Extensions

About Cache Extensions Cache extensions are a general-purpose mechanism to allow generic extensions to a cache. Cache extensions are tied into the cache lifecycle. For that reason, this interface has the lifecycle methods. Cache extensions are create

Intel® Threading Building Blocks (Intel® TBB) Developer Guide 中文 Parallelizing Data Flow and Dependence Graphs并行化data flow和依赖图

https://www.threadingbuildingblocks.org/docs/help/index.htm Parallelizing Data Flow and Dependency Graphs In addition to loop parallelism, the Intel® Threading Building Blocks (Intel® TBB) library also supports graph parallelism. It's possible to cre

Ehcache(2.9.x) - API Developer Guide, Blocking and Self Populating Caches

About Blocking and Self-Populating Caches The net.sf.ehcache.constructs package contains some applied caching classes which use the core classes to solve everyday caching problems. Two of these are BlockingCache and SelfPopulatingCache. Blocking Cach