10
Views
6
Comments
Editable Table Check if editable
Question
How to capture the event that makes the table editable? I want to change an element inside when the table is on editable mode.
2011-08-23 22-04-05
Tiago Simões
Staff
Hi Filipe,

Not sure if this is enough for you, but rows that are in edit mode have an OnEdit css class.

Cheers,
Tiago Simões
2024-01-05 16-00-17
Filipe Lourenço
Yeah i know but how to capture that to do other thing?
2011-08-23 22-04-05
Tiago Simões
Staff
Hi Filipe,

I believe you need a bit of jQuery magic for that. Something like this could eventually work:

$(#yourTableID).on('click', 'tbody>tr', function (event) {
	//check if row has an OnEdit class
});

$(#yourTableID).on('keypress keyup keydown', 'tbody input:not([type="submit"]), textarea, select', function (event) {
	//check if row has an OnEdit class
});
                        
2024-01-05 16-00-17
Filipe Lourenço
Did you test that code? It doesnt work because i guess outsystems is catching the capture after even with $(function(){..... });
2024-01-05 16-00-17
Filipe Lourenço
Yeap these jquery functions work but before the table take the OnEdit class
2011-08-23 22-04-05
Tiago Simões
Staff
Hi Filipe,

You can eventually use a setTimeout or setImediate to run some code after it (haven't tested it).
This does look like a good extensibility candidate, so probably we'll add some cleaner hooks in the future for these scenarios.

Thanks,
Tiago Simões

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.