UI Builder List Component's Inline editing: update record(s) requested event

staticCrash
Tera Guru

Hello,

I have a list on a UI builder page.   

I have a script mapped to the Inline editing: update record(s) requested event,

in this script i would like to stop the event from updating the tables.  

I would like to cancel the edit request, under certain conditions.

 

is this possible?  

Thank you,

 

Jay

 

//Not needed for now but may need to validate before the change is sent to the server side for update
    console.log('in update ranking now...');
    var colName = event.payload.multiRowInlineValue[0].column;
    console.log(colName);
    console.log(JSON.stringify(event.payload));
    //event.payload.multiRowInlineValue[0].value = 11;
    console.log(event.payload.table);
    event.payload.sysIds[0] = 'faketable';

 

1 ACCEPTED SOLUTION

Dibyaratnam
Tera Sage

I don't think it's possible to stop event after it's emitted. The event mapping that you have mentioned, will only allow you to do some additional activity once that event is emitted. The list edit is controlled with "glide.lists.inline_editing_enabled" system property. so even if you don't emit the mentioned event, the list record will be updated.

View solution in original post

3 REPLIES 3

Dibyaratnam
Tera Sage

I don't think it's possible to stop event after it's emitted. The event mapping that you have mentioned, will only allow you to do some additional activity once that event is emitted. The list edit is controlled with "glide.lists.inline_editing_enabled" system property. so even if you don't emit the mentioned event, the list record will be updated.

Thank you Dsam1 for your help.  🙂     

So I think I should leave the business logic on the backend then?  And maybe use the inline edit update fail event to report any failed updates due to violation of business rules?

 

Thanks again!

jay

Yes @staticCrash , use the update fail event mapping to catch if any error occurs and handle it as per your requirement using page client script.