Hello everyone!


I am using an editable table to link two entities, the table has 3 columns, each with a combo box input in them. Eveything works fine with it and my application(it saves and does what is supposed to do) my question is in regard to a small user experience bug I am having. When the user hits the 'X' to cancel the current row being edited I would like for all three drop boxes to go back to their default empty value. Right now what happens is the user selects the three options, hits cancel, then hit add new row and their options will still be selected. Is there a way I can maybe link an action to the cancel current row button? Or is there another way to set all values of the current row of combo boxes to nullidentifier() when the 'X' button is pressed?


Thanks!

Phil

Solution

Hi Felipe,

I don't think there's an easy way to hook into the cancel edit button. 

You could consider setting those dropdowns with Javascript to get their values back to their default. You'd have to add a click event to the link that cancels the edit. Something like this:

$(".CancelRowAction").click(
   function() {  
       $(".YourComboBoxClass").val('YourEmptyValue');
   }
);
Solution

Thanks Afonso if no one has a simpler solution for me I will mark your reply as the soltuion. ;)

No problem! Someone might have a better idea - the Editable Table widget is very convenient if you don't need customisation, but I've found myself just implementing the same with a TableRecords if I need more behaviours or different reactions.