jQWidgets Forums

jQuery UI Widgets Forums Grid Multicell Copy-Paste

This topic contains 11 replies, has 4 voices, and was last updated by  Peter Stoev 10 years, 3 months ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
  • Multicell Copy-Paste #13995

    Morgenhund
    Member

    Dear Developers,

    for our CRM application ability to copy and paste multiple cells at once between jqxGrid and Excel is crucial (from selected areas up to entire Excel tables).

    But it seems that jqxGrid lacks this ability, or maybe I’m missing something?

    Thank you in advance!

    Multicell Copy-Paste #13997

    Peter Stoev
    Keymaster

    Hi Morgenhund,

    Cut, Copy and Paste via Clipboard operations is already implemented. However, Clipboard operations are possible only in Internet Explorer. Other browsers do not allow Clipboard operations due to security reasons.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Multicell Copy-Paste #14050

    Morgenhund
    Member

    Hello,

    I filled four cells in Excel with the folllowing data:
    aaa bbb
    ccc ddd

    I selected them and copied into Clipboard.

    Then, I gave focus to jqxGrid (default demo jqwidgets/demos/jqxgrid/cellediting.htm), an empty cell selected without editing started.

    Then, I tried to paste data to jqxGrid

    After that, nothing happens.

    Next test: 4 cells in jqxGrid filled with sample data (2×2), copied to the Clipboard, browser asks access to clipboard and is allowed that.

    Trying to paste data into same qjxGrid (to empty cells) resulted in only the first cell copied, not the other 3 cells.

    MS Excel Version: 9.0.12
    jqWidgets version: the latest at the moment (2.6.1)

    Is this designed behaviour?

    Thank you in advance!

    Multicell Copy-Paste #14054

    Peter Stoev
    Keymaster

    Hi Morgenhund,

    In the cellediting.htm, there are no empty cells so I do not know how you selected and pasted to empty cells.

    The behavior works as expected on my side:

    1. Open Internet Explorer
    2. Select 4 grid cells. Ex: 0,0, 0,1,1,0,1,1
    3. Press Ctrl+C
    4. Select 4 other cells
    5. Press Ctrl+V
    6. The selected cells are updated with the new values as expected.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Multicell Copy-Paste #14057

    Morgenhund
    Member

    Hi Peter,

    sorry, I have not mentioned that I cleared the cells before pasted to them (select+Del taste)

    However, in my attempt, as per your last description, only the first (top-left) cell is pasted.

    Multicell Copy-Paste #14058

    Peter Stoev
    Keymaster

    Hi Morgenhund,

    When you copy 4 cells values, and you want to paste all of them anywhere in the Grid, you should select 4 cells again and press Ctrl+V.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Multicell Copy-Paste #68500

    ypahnu
    Participant

    How about if I paste 2 rows into a grid with 1 row?

    It would be great that more rows appear as I past it from excel.
    I notice that

    $("#myExcel").on('cellendedit', function (event)
    console.log(event.args.rowindex);

    show 0 on 1st row
    show -1 on 2nd row,

    There’s anyway to extend the size of the grid on paste?

    My humble solution

    if(rowBoundIndex === -1 && dataField==="tipo"){
                    console.log("ADD row");
                    console.log(rowData);
                    $("#myExcel").jqxGrid('addrow', null, {tipo: value});
    }
    Multicell Copy-Paste #68501

    Peter Stoev
    Keymaster

    Hi ypahnu,

    There’s no way to extend the Grid’s size on paste.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Multicell Copy-Paste #68503

    ypahnu
    Participant
    if(rowBoundIndex === -1 && dataField==="tipo"){
                    console.log("ADD row");
                    console.log(rowData);
                    $("#myExcel").jqxGrid('addrow', null, {tipo: value});

    My solution, can’t find any other way .. just started to day on grids. Thanks

    Multicell Copy-Paste #68505

    Peter Stoev
    Keymaster

    Hi ypahnu,

    The code adds a row but it’s not related to the clipboard operations i.e with the Paste.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    Multicell Copy-Paste #68633

    JackalDark
    Participant

    Hi Peter,

    If we wanted to add more rows upon pasting data into a grid, how could we achieve that exactly?

    Can we use this cell edit method as stated above?

    Use case would be:
    1. Empty grid with 10 rows
    2. User pastes 20 rows of data

    Would we need to ensure the grid has more empty rows than the user could possibly paste to start?

    What if we start with:
    1. Empty grid with 50 rows
    2. User pastes 40 rows
    3. Grid adds 40 blank rows automatically so that the user could paste more rows

    How could we achieve this?
    Thanks

    Multicell Copy-Paste #68634

    Peter Stoev
    Keymaster

    Hi JackalDark,

    Unfortunately, I don’t know how something like that can be achieved. The Grid does not have built-in feature for that and I usually don’t suggest calling “addrow” within “cellendedit” because “cellendedit” makes Update of a Cell and “addrow” adds a row – both operations which require Grid refresh.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.