Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #103500
    edwardsmarkff
    Participant

    hello – is there a delete event?

    i see that the “change” event works, but only when all the rows are deleted.

    #103502
    edwardsmarkff
    Participant

    here is what i mean:

    https://www.htmlelements.com/demos/grid/editing-dialog/

    https://codepen.io/edwardsmarkf/pen/KKobVwj

    i need to be able to determine which row was deleted by a jScript event.

    • This reply was modified 1 year, 10 months ago by edwardsmarkff.
    #103504
    edwardsmarkff
    Participant

    this did not work:

    for ( const [key, value] in document.getElementsByClassName('smart-icon-delete') )
    {      let thisVal = document.getElementsByClassName('smart-icon-delete')[key] ;
    . . . . console.log(thisVal);
    . . . . console.log (typeof thisVal) ;
    . . . . thisVal.addEventListener('click', (event) => { console.table(event); } )
    }
    #103507
    ivanpeevski
    Participant

    Hi,

    The onRowRemoved callback function is used for that.

    Please note that it is set as a property, and not as an Event.

    You can see an example here: codepen. The indexes of the row will be console logged.

     

    Best Regards,
    Ivan Peevski
    Smart HTMLElements Team
    https://www.htmlelements.com/

    #103509
    edwardsmarkff
    Participant

    is it possible to get the data contained in the row?   the function onRowRemoved() appears to lose the data.

    so this does not seem to work for me:

    https://codepen.io/edwardsmarkf/pen/JjLwzGQ

    or does require a new function “onRowRemoving()” dedicated to me?   😂🤣😂🤣

    • This reply was modified 1 year, 10 months ago by edwardsmarkff.
    #103511
    ivanpeevski
    Participant

    Hi,

    In this case, please see the example here: codepen

    If the row was deleted with the delete command button, you can use the onCommand callback function to get the row index before it was deleted. It also allows you to cancel the row delete operation by setting command.handled = true;

     

    Best Regards,
    Ivan Peevski
    Smart HTMLElements Team
    https://www.htmlelements.com/

    #103512
    edwardsmarkff
    Participant

    <span style=”text-decoration: underline;”>thank you very much.</span>

    https://codepen.io/edwardsmarkf/pen/LYdqxWP  😁

    i should think this would be necessary enough to require its own unique event:  “onRowRemoving()” .

    #103515
    edwardsmarkff
    Participant

    or another dumb question:   would it be possible perhaps in a future release to also include the deleted row with the onRowRemoved() callback ??

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.