• handsontable-developer guide-cell type


    单元格类型:这里有很多没见过的用法,得好好总结一下

    //预定义的类型
    Text Numeric Checkbox Date Select Dropdown Autocomplete Password Handsontable in Handsontable Custom
    var data = [
        {id: 1, name: 'Ted', isActive: true, color: 'orange', date: '2015-01-01'},
        {id: 2, name: 'John', isActive: false, color: 'black', date: null},
        {id: 3, name: 'Al', isActive: true, color: 'red', date: null},
        {id: 4, name: 'Ben', isActive: false, color: 'blue', date: null}
      ],
      container = document.getElementById('example'),
      hot,
      yellowRenderer,
      greenRenderer;
    
    yellowRenderer = function(instance, td, row, col, prop, value, cellProperties){
      //renderer,少加了个s Handsontable.renderers.TextRenderer.apply(this, arguments); td.style.backgroundColor = 'yellow'; }; greenRenderer = function(instance, td, row, col, prop, value, cellProperties){ Handsontable.renderers.TextRenderer.apply(this, arguments); td.style.backgroundColor = 'green'; }; hot = Handsontable(container, { data:data, startRows: 5, colHeader: true, minSpareRows: 1, columns: [ {data:'id'}, {data:'name', renderer:yellowRenderer}, {data:'isActive', type:'checkbox'},
      //date写成了data {data:'date', type:'date', deteFormat:'YYYY-MM-DD'}, {data:'color', type:'autocomplete', source:['yellow', 'red', 'orange', 'blue', 'green']} ], cell: [ {row:1, col:0, renderer: greenRenderer} ], cells: function(row, col, prop){ if(row === 0 && col === 0){ this.renderer = greenRenderer; } } });
    columns: [{
      type: 'text'
    }]
    等于
    columns: [{
      renderer: Handsontable.renderers.TextRenderer,
      editor: Handsontable.editors.TextEditor
    }]
    
  • 相关阅读:
    POJ 1201 Intervals 差分约束
    netframework2.0,asp.net2.0,vs.net 2005
    学习.net第一天
    VS.NET 2003 控件命名规范
    .Net生成共享程序集
    汉字的编码
    [转]用C#实现连接池
    SQL表自连接用法
    一道很好玩的OOP面试题,今天比较有空,所有做了一下
    C#编程规范(2008年4月新版)
  • 原文地址:https://www.cnblogs.com/wang-jing/p/4656313.html
Copyright © 2020-2023  润新知