How to set value of field when using bubble editor in standalone mode?

How to set value of field when using bubble editor in standalone mode?

daveslabdaveslab Posts: 40Questions: 14Answers: 0

Hi folks,

I am using editor in standalone mode with bubble editing to edit a document where I do not want it to update the document for me. Therefore, I intend to rely on set and the edit event. However, when I try to edit the field values before opening it doesn't work. Here is what I've tried:

editor
  .set('MyField', true)
  .bubble( this);

Any ideas?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Are you able to link to the page so I can see the issue in place please?

    Thanks,
    Allan

  • daveslabdaveslab Posts: 40Questions: 14Answers: 0

    Unfortunately, it's on a internal project that I can't publish. I put together a fake example just to give an idea of what I want to do, but as you can see it doesn't work.

    http://codepen.io/anon/pen/QygoOB

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    Ah - I see thanks!

    Could you try simply swapping the two calls around to be:

        editor
          .bubble(this)
          .set('smiley', true);
    

    Thanks,
    Allan

  • daveslabdaveslab Posts: 40Questions: 14Answers: 0

    Oh, man, that's frustrating. It was indeed that. Thanks!

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    I should have explained the reason for that - when bubble() is called it will attempt to set the values for the from. i.e. it is that which starts the edit and you can then modify the form after that point.

    Allan

This discussion has been closed.