jQWidgets Forums

jQuery UI Widgets Forums Grid Protect certain cells from being overwritten when pasting

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

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author

  • MrWinky
    Participant

    I am using 3.8.1. One of my columns is an ID column. When the user copies and pastes one single row over another single existing row, the updaterow event is only passed the copied row data – I have no way to control what happens to the destination row other than commit or reject the entire change. I don’t mind all the other values being updated (just not the id). I can’t find a way to “protect” that one ID column. I tried setting “clipboard: false” for that one column but it didn’t make a difference.

    And I don’t see a way in updaterow to find and restore the previous ID value for that newly updated row…. besides which … updaterow will be called around 15 times for each column in the updatedrow .. I wish there was a way to just get one event when it was pasted to and make the choice of what cells to update. maybe I am using the wrong event?

    Any suggestions would be appreciated.

    {
    text: ‘Id’,
    editable: false,
    width: ’60’,
    datafield: ‘id’,
    displayfield: ‘id’,
    hidden: false,
    clipboard: false

    },


    Peter Stoev
    Keymaster

    Hi MrWinky,

    There is unfortunately no property called clipboard: false per column. we will consider adding such for future jqxGrid updates. At present, a workaround is not available.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    MrWinky
    Participant

    Hi –

    3 quick followup questions:

    1. Am I correct there is NOT a way I can reject the cell’s change via another event like cellChanged… correct?

    2. Is there a way I can translate the screen rowed passed to the actual rowid to the source array (assume the user sorted the list or used filters)

    3. Is their anything I can do if I capture Ctrl + V (or any other event) and somehow iterate through the list of source (copy) rows and manually update the destination rows myself?


    Peter Stoev
    Keymaster

    Hi MrWinky,

    1. Events are raised after an action so it’s not possible to cancel the change after it is already changed.
    2. I do not understand what you mean here.
    3. You can try that by using the handlekeyboardnavigation callback function, but it would not be very easy for implementation.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.