preClose Event

preClose Event

Karl53Karl53 Posts: 72Questions: 29Answers: 0

Editor v1.4 Inline editing.

preClose is documented as :

Form close event - Triggered before the form is closed (cancelable)

First, how is Form used in this context?

I'm looking for an event that is triggered prior to the editor closing and the active cell loses focus. preClose seems to meet my needs, but the above explanation does not make it clear if this is supported use.

Answers

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    First, how is Form used in this context?

    Do you mean the use of the word "form" in my description? It basically means any Editor controlled input elements on the page.

    What you describe sounds like what the preClose event does - however, you should be aware that the element might not loose focus until after it has been removed from the document - if it event does that. As we have discussed by e-mail, a number of browsers will not fire a blur event on an active focused element that is simply removed from the document.

    Regards,
    Allan

  • Karl53Karl53 Posts: 72Questions: 29Answers: 0

    Yes, that's what I was asking about. Just want to confirm I understood the meaning. I thought I would utilize the preClose event because of the difference in the way the browsers fire a blur event. So given:

        .on('open', function () {
                 document.getElementById('my-id').value = 'ABC';
        })
    
        .on('preClose', function () {
                 document.getElementById('my-id').value = 'XYZ';
        })
    

    After the editor closes, I had thought that the cell element would hold 'XYZ'. It doesn't for me. (v1.4).

    In version 1.5, the element does show XYZ, but Editor crashes (no errors shown). but I can't open a form on any other cell. Now, this could very well be my bug in the way I've initialized v1.5. I'll forward you an example project via email.

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    Sounds interesting - thanks.

    Allan

This discussion has been closed.