0
사용자가 ng2 핸즈프리의 데이터를 복사 할 때 열 머리글을 추가하려고합니다. Before 복사 이벤트가 발생하고 이벤트의 데이터를 변경할 수 있지만 클립 보드에 복사 된 내용은 변경되지 않습니다.ng2-handsontable beforeCopy Angular2 +
는https://docs.handsontable.com/pro/1.14.2/Hooks.html#event:beforeCopy
이것은 내가 처음 작업을 얻으려고 노력하고있는 단순화 된 버전입니다. 저는 항상 4 열 모두를 선택하고 있습니다.
private beforeCopy(e: any) {
// e[0] is an array of the data
// e[1] is an array of the coords
e[0][0][0] = "test";
}
두 기능을 수행하지만, 결국 클립 보드의 데이터는 편집되지 않은 데이터입니다 : 모든 데이터를 변경할 수있는 경우
private beforeCopy(e: any) {
// e[0] is an array of the data
// e[1] is an array of the coords
var headers = ["Step 1", "Step 2", "Step 3", "Step 4"];
e[0] = [headers, ...e[0]];
e[1][0] = { endCol: headers.length-1, endRow: e[0].length-1, startCol: 0, startRow: 0};
}
슈퍼 간단한 버전을 테스트합니다.