Editable List: Cancel removeItem?

Hi, is there any way to cancel a removeItem?

I have an editable list defined as:

$('#node-input-packageList').editableList({
    addItem: addPackageRow, // function
    removeItem: removePackageRow, // function(data){},
    resizeItem: function(row,index) {},
    header: $('<div>').append('<h4 style="display: inline-grid">Installed Packages</h4>'),
    height: 'auto',
    addButton: true,
    removable: true,
    scrollOnAdd: true,
    sortable: false,
})

With the removePackageRow function defined as:

function removePackageRow(data) {
    // ... ????
}

I would like to do some processing in removePackageRow that may result in the removeItem needing to be cancelled. e.g. if an API call fails.

Is there any way to achieve this?

Or do I need to add my own button to each row and process things that way?

Thanks, Julian.

Note that, for now, I've worked around the issue by calling addItem with the original name. So if the process fails or errors, I just add the item back again.

Not terribly good UX since the user sees the entry disappear and then reappear again.

It would also be nice to have an official busy spinner for add and remove item calls rather than me having to hack my own onto the end of the add button.

If you are interested in the code, you will find it in the JavaScript section of uibuilder.html later on tonight when I commit it.

I have to say that playing with remote control of npm is really horrible! It insists on producing loads of really c***p output in a very hacky way even when you ask it nicely to return JSON.

However, I think that I've cracked that now. So that you can add and remove npm packages to your userDir folder right from within the admin ui. No log output yet like the palette manager does it but I'll get to that eventually. The log output is all returned in one go at the moment and I don't really use it for now. Though an error in npm should dump some info to the console of the browser. npm processing produces a few entries in the node-red log as well.