ユーザ用ツール

サイト用ツール


it技術:web開発:handsontable

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
次のリビジョン
前のリビジョン
it技術:web開発:handsontable [2021/08/15 21:38] yajuadminit技術:web開発:handsontable [2021/09/18 02:05] (現在) – [カスタムエディター] yajuadmin
行 131: 行 131:
     if (source === 'loadData') return;     if (source === 'loadData') return;
  
-    for (var i = 0; i < changes.length; i++) {+    for (let i = 0; i < changes.length; i++) {
         let change = changes[i];         let change = changes[i];
         // 編集と選択は対象外         // 編集と選択は対象外
行 168: 行 168:
 'use strict'; 'use strict';
  
-var MaxLengthEditor = Handsontable.editors.TextEditor.prototype.extend();+let MaxLengthEditor = Handsontable.editors.TextEditor.prototype.extend();
  
 MaxLengthEditor.prototype.prepare = function () { MaxLengthEditor.prototype.prepare = function () {
行 182: 行 182:
  
 // 使い方 // 使い方
-var table = new Handsontable(grid, {+let table = new Handsontable(grid, {
     data: data,      data: data, 
     columns: [     columns: [
行 217: 行 217:
 const dtFormat = 'YYYY/MM/DD'; const dtFormat = 'YYYY/MM/DD';
          
-var isFuture = function (value, callback) {+let isFuture = function (value, callback) {
     if (moment(value, dtFormat).isValid() && value > moment(new Date()).format(dtFormat)) {     if (moment(value, dtFormat).isValid() && value > moment(new Date()).format(dtFormat)) {
         callback(false);         callback(false);
行 894: 行 894:
 === 変更後イメージ === === 変更後イメージ ===
 {{:it技術:web開発:datapicker.png}} {{:it技術:web開発:datapicker.png}}
 +
 +===== EditorManager =====
 +EditorManagerを使用してカスタムエディターを作成することが出来る。
 +==== Tips ====
 +  * open時直後に、event.stopPropagation(); を入れるとマウスダウンされたままなのでセル移動すると領域選択された状態になってしまう。
 +
 +==== 参照 ====
 +  * [[https://anz-note.tumblr.com/post/133670437421/jshandsontable%E3%81%AEeditormanager%E3%82%92%E4%BD%BF%E3%81%A3%E3%81%A6%E3%81%BF%E3%81%9F|[js]HandsontableのEditorManagerを使ってみた]]
 +  * [[https://gist.github.com/paulduran/e70a3084e925ce0ff27b|select2-editor.js - GithubGist]]
 +  * [[https://github.com/mydea/handsontable-chosen-editor|Handsontable-chosen-editor - Github]] 
it技術/web開発/handsontable.1629031134.txt.gz · 最終更新: 2021/08/15 21:38 by yajuadmin