! 제품 버전을 정확하게 입력해 주세요.
제품 버전이 정확하게 기재되어 있지 않은 경우,
최신 버전을 기준으로 안내 드리므로
더욱 빠르고 명확한 안내를 위해
제품 버전을 정확하게 입력해 주세요!

SpreadJS - Customize Ctrl + Shift + Down has error when paste data > Q&A | 토론

본문 바로가기

SpreadJS

Q&A | 토론

PureJS SpreadJS - Customize Ctrl + Shift + Down has error when paste data

페이지 정보

작성자 Rotterdam 작성일 2022-12-12 10:18 조회 543회 댓글 0건
제품 버전 : 15.2.5

본문

Hello GrapeCity Korea, 

During implementing project, we are facing with an issue related to paste data. 

Because spreadJs only support selection bottom when using ctrl + shift + down (image below).


 

So we customize this command as below:


var commandD = {

        canUndo: true,

        execute: function (spread, options, isUndo) {

            var Commands = GC.Spread.Sheets.Commands;

            if (isUndo) {

                Commands.undoTransaction(spread, options);

                return true;

            } else {

                options.cmd = "D";

                Commands.startTransaction(spread, options);

                spread.suspendPaint();

                arrowKey(40, sheet);

                spread.resumePaint();

                Commands.endTransaction(spread, options);

                return true;

            }

        }

    };

var commandManager = spreadEffort.commandManager();

commandManager.register('D', commandD, 40, true, true, false, false);

function arrowKey(key, sheet) {

    var arrSelection = sheet.getSelections()[0];

    var rowCount = sheet.getRowCount();

    var columnCount = sheet.getColumnCount();

    var rowEnd = 1;

    if (key == 40) {

        rowEnd = 1;

        var rowSelection = arrSelection.rowCount;

        if (sheet.getText(arrSelection.row + rowSelection, arrSelection.col) == '') {

            for (var i = arrSelection.row + rowSelection; i <= rowCount; i++) {

                rowEnd += 1;

                if (sheet.getText(i, arrSelection.col) != '') {

                    break;

                }

            }

            sheet.addSelection(arrSelection.row, arrSelection.col, rowEnd + rowSelection -1, arrSelection.colCount);

            sheet.setSelection(arrSelection.row, arrSelection.col, rowEnd + rowSelection -1, arrSelection.colCount);

        }

        else {

            for (var i = arrSelection.row + rowSelection; i <= rowCount; i++) {

                rowEnd += 1;

                if (sheet.getText(i, arrSelection.col) == '') {

                    break;

                }

            }

            sheet.addSelection(arrSelection.row, arrSelection.col, rowEnd - 2 + rowSelection, arrSelection.colCount);

            sheet.setSelection(arrSelection.row, arrSelection.col, rowEnd - 2 + rowSelection, arrSelection.colCount);

        }

    }


Now, we can use ctrl + shift + down for selecting range between 2 values (image below).


But an error happen when we paste value (image below).


 

Please support us solve this error.

We are looking for your support.

Thank you.






  • 페이스북으로 공유
  • 트위터로  공유
  • 링크 복사
  • 카카오톡으로 보내기

댓글목록

등록된 댓글이 없습니다.

1 답변

PureJS Re: SpreadJS - Customize Ctrl + Shift + Down has error when paste data

추천0 이 글을 추천하셨습니다 비추천0 채택채택

페이지 정보

작성자 GCK루카스 작성일 2022-12-12 15:15 댓글 0건

본문

안녕하세요 그레이프시티입니다.


SpreadJS의 각 시트는 행의 개수가 정해져 있으며, 값을 붙여넣기 할 때 시트의 범위를 벗어나는 경우 해당 팝업 창이 나타나게 됩니다.

e65c664a46839280db3bdb72d6c190d6_1670825479_6872.gif
 

붙여넣기 시 벗어난 범위만큼 자동으로 행의 개수를 늘려주려면 아래 옵션을 사용해 보시기 바랍니다.

spread.options.allowExtendPasteRange = true;

확장된 범위 붙여넣기 데모


* 본 포럼의 운영 목적은 문의 사항에 대해 안내 드림과 동시에 비슷한 궁금증을 가진 다른 개발자 분들과 내용을 공유하기 위함임으로, 가능한 한국어로 문의 주시길 부탁 드립니다.


감사합니다.

그레이프시티 드림

댓글목록

등록된 댓글이 없습니다.

메시어스 홈페이지를 통해 제품에 대해서 더 자세히 알아 보세요!
홈페이지 바로가기
메시어스 홈페이지를 통해 제품에 대해서 더 자세히 알아 보세요!
홈페이지 바로가기
이메일 : sales-kor@mescius.com | 전화 : 1670-0583 | 경기도 과천시 과천대로 7길 33, 디테크타워 B동 1107호 메시어스(주) 대표자 : 허경명 | 사업자등록번호 : 123-84-00981 | 통신판매업신고번호 : 2013-경기안양-00331 ⓒ 2024 MESCIUS inc. All rights reserved.