2016-07-21 8 views
0

移動した後に2つの列をフリーズしたいと思います。移動後の列をフリーズ

例:JSFiddle

var 
    myData = Handsontable.helper.createSpreadsheetData(10, 50), 
    container = document.getElementById('example1'), 
    hot; 

hot = new Handsontable(container, { 
    data: myData, 
    rowHeaders: false, 
    colHeaders: true, 
    preventOverflow: 'horizontal', 
    allowInsertRow: false, 
    allowInsertColumn: false, 
    fixedColumnsLeft: 2, 
    contextMenu: false, 
    manualColumnMove: [2, 5], 
    manualColumnFreeze: true 
}); 

しかし、それは私がオプションでそれらを移動した後...

がどのように私は手動の動きをブロックすることができ、手動の後、再びそれらを移動することが可能ですか?

固定列をフリーズするだけですか?

みんなありがとう;)

+0

manualColumnFreezeプロパティはそのためです。あなたはすでにそれを使っているのが分かります。 – Aravind

+0

はい、すでに1番目と2番目の列を移動できます。 –

答えて

0

私は最終的に列を凍結する方法を見つけることが、ガイドが常に表示されます。

ソリューション:JSFiddle

var 
    myData = Handsontable.helper.createSpreadsheetData(10, 50), 
    container = document.getElementById('example1'), 
    hot, 
    fixedColumnsLeft = 2; 

hot = new Handsontable(container, { 
    data: myData, 
    rowHeaders: false, 
    colHeaders: true, 
    preventOverflow: 'horizontal', 
    allowInsertRow: false, 
    allowInsertColumn: false, 
    fixedColumnsLeft: fixedColumnsLeft, 
    contextMenu: false, 
    manualColumnMove: true, 
    manualColumnFreeze: true, 
    beforeColumnMove: setBeforeColumnMove(), 
}); 

function setBeforeColumnMove() { 
    return function(startColumn, endColumn) { 
     var manualColumnMove = hot.getPlugin("ManualColumnMove"); 

     if (startColumn < fixedColumnsLeft || endColumn < fixedColumnsLeft) { 
     manualColumnMove.changeColumnPositions(endColumn, startColumn); 
     } 
    } 
}; 
関連する問題