Jeditable -- Error with onblur:submit and clicking Textbox
I have开发者_如何学Python a table where you input your hours. Mouseover doesn't appear to do anything. Click, dblclick and focus do.
I can not only have ENTER for submit, this is why onblur: submit. If I use any click or focus , the focus one a "text" , then another "text" right after (before clicking else where) , the second "text" opens -> closes then becomes uneditable. PLEASE and thank you. Using Jeditable 1.4.3 When I comment out the onblur:submit, i do not get the text box error. I would like to use mouseover and even mouseout to submit if possible.
code can be found here...
http://pastebin.com/7FC7pD1x
EDIT: Possible solution at the end
I think I understand what you're getting at because I'm having the same issue (and haven't seen any solutions yet).
If I understand correctly, the problem is this:
If you have a table where each cell is bound to jedtiable with onblur: 'submit' you'd expect that when you click one cell, make an edit and then click another cell that the first cell would submit and you'd be able to continue making edits to the second cell. However, what seems to happen is that you click the first cell, make your edit, click the second cell (blurring the first cell and causing a submit on the first cell), begin editing the second cell and then as soon as the first cell submits the second cell receives a blur event and submits and closes.
What you want to happen is for the first cell to submit and close but leave the second cell open and editing. I'm not sure why it's getting a blur event when the first cell submits.
EDIT
I found a possible solution although it requires a hack of jeditable.
If you add a setTimeout to the code block in jeditable that puts focus on the input box it seems to fix the issue.
Find this line in jeditable:
$(":input:visible:enabled:first", form).focus();
and change it to:
setTimeout(function() {
$(":input:visible:enabled:first", form).focus();
}, 500);
That seems to do it but I'm hoping there's a better way.
精彩评论