zoukankan      html  css  js  c++  java
  • 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)就可以
    
  • 相关阅读:
    【NOIP2018】游记
    题解 P1441 【砝码称重】
    题解 P3128 【[USACO15DEC]最大流Max Flow】
    题解 P1949 【聪明的打字员_NOI导刊2011提高(10)】
    题解 P1966 【火柴排队】
    题解 P1895 【数字序列】
    topcoder做题
    1149E
    hdu 6589
    hdu 6579
  • 原文地址:https://www.cnblogs.com/wang-jing/p/4656310.html
Copyright © 2011-2022 走看看