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)就可以
    
  • 相关阅读:
    yum 安装pip
    sed和awk用法
    awk删除最后一个字符
    shell读取文件内容并进行变量赋值
    git 添加、提交、推送
    git 本地代码冲突解决,强制更新
    sys系统模块
    os模块
    time-时间模块
    环境变量的使用
  • 原文地址:https://www.cnblogs.com/wang-jing/p/4656310.html
Copyright © 2011-2022 走看看