It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to access via JS?

Stefan Niedermann Feb 18, 2013

Hi,

with TinyMCE we were able to access to the fieldvalue via Javascript, for example:

jQuery("#mce_1").val("My Value");

is this possible with JEditor, too?

3 answers

1 accepted

1 vote
Answer accepted
Alex B Feb 19, 2013

Hi Stefan,

It is possible:

AJS.$('.jeditor_inst') - returns an array of JEditor-enabled textareas

AJS.$('.jeditor_inst')[0].value - returns the value of the first instance in the array

AJS.$('.jeditor_inst[name="description"]').val() - returns value of the Description field

Our support team will be glad to help you with the script if you need to access JEditor via JS. You can contact us via the helpdesk or by emailing to support@jiraeditor.com

Stefan Niedermann May 27, 2013

this is just reading access - how can i write some content into a jeditor instance?

0 votes
Alex B May 27, 2013

Hi Stefan,

We will ship easy to use javascript API (read/write access to JEditor instances) with the next release.

I'll post the download link here as soon as we have the preview build.

Stefan Niedermann May 28, 2013

sounds nice, but i need a workaround until the version will be released...

0 votes
Alex B May 28, 2013

Hi Stefan,

We have shipped a preview build: http://jiraeditor.com/builds/jeditor-1.5.40.1.jar.

After installation you can use the following functions to get and set value of JEditor instance:

jeditorGetData( fieldname )

jeditorSetData( fieldName, data )

Parameter fieldName here is name of field. For the Description field fieldName would be "description", for the Comment field it would be "comment". For custom fields you need to pass "customfield_id" as fieldName instead of label. For example:

jeditorGetData("description")

jeditorSetData("comment","some text")

jeditorSetData("description","<p>some text</p>")

jeditorGetData("customfield_10000")

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Posted in Marketplace Apps & Integrations

Demo Den Ep. 4: Continuous Integration with CircleCI & Jira Software

Get ready! Demo Den Episode 4 is coming your way on Tuesday, May 28, 2018 with a Continuous Integration and Delivery special demo. CircleCI Director of Solutions Engineering, Eddie Webb will show us ...

450 views 0 4
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you