Weird rendering of bubble editor when called by double-click first time after page load

Weird rendering of bubble editor when called by double-click first time after page load

ben.hellben.hell Posts: 7Questions: 3Answers: 1

Hi,

I would like to enable editing by double-clicking the row, using this code:

$('#hglog').on('dblclick', 'tr', function (e) { editor.edit(this); });

When the page is freshly loaded, double-clicking the row opens the edit bubble but with Upgrade button missing and a very small upper bar (see picture). When using the Edit Button everything is fine. After that, double-clicking again on the row also shows a complete edit bubble.

What is going wrong here? Help is very much appreciated as this behaviour is a bit irritating ;-)

Best,

Ben

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,438Questions: 1Answers: 10,049 Site admin

    If you are calling edit() directly, you also need to set buttons and a title (buttons() and title()). You can do that using the form-options, or the methods directly.

    e.g.:

    editor
      .edit( this )
      .title( 'Edit' )
      .buttons( 'Save' );
    

    Allan

  • ben.hellben.hell Posts: 7Questions: 3Answers: 1
    Answer ✓

    Hi Allan,

    Thanks for your answer. First, it did not work. I had to change the order a bit, so

    editor.title('Edit entry').buttons('Update').edit(this);

    did the trick!

    Thanks a lot,

    Ben

  • allanallan Posts: 61,438Questions: 1Answers: 10,049 Site admin

    Interesting - I'll look into that. But good to hear you have it working!

    Allan

  • classic12classic12 Posts: 228Questions: 60Answers: 4

    I have the above code working on desktop but it fails on mobile.

    When I attempt the double click it simply selects / deselect the row.

    Any other event I can try ?

    Cheers

    Steve Warby

  • allanallan Posts: 61,438Questions: 1Answers: 10,049 Site admin

    Sounds like you have a click event listener on the row. You can't reliably use both a click and double click listener on the same element since you don't know if the first click is the only click, or part of a double click.

    Allan

This discussion has been closed.