disable focus fields
disable focus fields
Andreas S.
Posts: 208Questions: 74Answers: 4
in Editor
I did not want, that the focus will set automatically on the first input field, if I open a create or edit windows. I tried it with the following code, but this did not work:
$( '#eventtable' ).on( 'click', 'tbody tr', function() {
editor.create( this, {
focus: null
} );
editor.edit( this, {
focus: null
} );
} );
Has anyone some ideas what is wrong with my code?
Andreas
This discussion has been closed.
Replies
I have just tried this and it worked fine:
Your code doesn't really make sense to me.
You can't edit the row you click on and create a new one at the same time. You would probably need different events. Unless you want to open an Editor instance upon click on a single table row I would use the event on click of the Edit button. For create I don't see any other option than clicking on the Create button.
These buttons do the job. If you use these two buttons you don't need the code above at all:
use the
formOptions.main
object in this case:Allan
I try this, but the focus is always set to the first field (curser is in this field) of the editor windows.
Can you give me a link to a page showing the issue please?
Thanks,
Allan
Send you a PM
I have implement the workaround from rf1234. That solve my focus problem, but I have a new Problem. If I enter a char in a inbox field I get following error:
Unable to get property 'isPersonal' of undefined or null reference
I think I have forgot something in my code, but I did not know what. This error is only in the create form. Have anyone a hint for me?
Andreas
Here my editor Code:
And my Datatable:
I'm not sure where that error is coming from. I don't see
isPersonal
in your code anywhere above.Allan
oh, I see now where the problem comes. I is a extension in the edge browser ( Bing Translator)
Andreas