2
Good morning guys, next, I’m wanting to do a quick CRUD mode, in editing, for example, ADM gives 2 clicks in the field to be edited, and the field becomes editable with 2 buttons to the right, one to confirm and one to cancel.
What I’ve been doing is:
https://jsfiddle.net/gn5pmjzc/
Make the following example:
Give 2 clicks on Roberto Afonso, now give 2 clicks on it again. Note that the text is deleted.
My idea was, prevent this "dlbClick" from running, until the X or V icon was clicked, then remained normal..
How can I do?
Thank you to those who answer!
Ahaam, we have a little problem.. Icons to accept editing or not, are not appearing. What happens is that: https://jsfiddle.net/gn5pmjzc/2/ I put the function when clicking outside the "EDIT" closes, now if I need to edit again, do not change the "text" of the input. Because technically you had him cancel that... :(
– Hermus
Someone else can help?
– Hermus
@Hermus these icons come from where? I think this is CSS right? Boostrap maybe?
– Sergio
It is a framework called SEMANTIC-UI.... But the problem is JS even, after "locking" the event, it does not enable use again :/
– Hermus
@Hermus cleaned up your code a little https://jsfiddle.net/gn5pmjzc/3/ but I still don’t understand what doesn’t work. You can try?
– Sergio
Old, that was basically it, this example worked perfectly, with the exception that in the console is showing me this error, every time I give 2 clicks in td: Uncaught Typeerror: e.preventDefault is not a Function -- jquery-3.1.0.js:5110
– Hermus
I replaced this with: if ($el.hasClass("cellulaEmEdical")) Return Event.preventDefault(); Thank you so much for your help and the time Sergio. Thank you
– Hermus