Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

how to render the selected value in my input text and auiSelecte2() with ajax ?

TARYOUS Saad
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 13, 2018

I'm trying to make a custom field plugin for Jira service desk, in the edit.vm file i m using an input text and the script for auiSelect2() with ajax call ,all work fine the problem is when i  select an option and confirm and when i go back to my custom field again (that have an already selected option) , the input doesn't  look like an aui Select field it just a simple input text with a value equals to the id of the selected option. 

 

1 answer

0 votes
Daz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 9, 2018

Hi @TARYOUS Saad!

I'm not sure if you managed to solve your problem yet, but I have a theory as to why your field isn't working.

I created a codepen to demonstrate my understanding of your problem, as well as what I believe the fix to be: https://codepen.io/chrisdarroch/pen/OZQNXy

As shown in that codepen, I believe your problem is that the HTML for the select field is being completely destroyed, then reconstructed again later. That itself isn't a problem, provided that you call `$element.auiSelect2()` again once the HTML is reconstructed. I suspect your plugin code is only calling `auiSelect2()` on the element one time at page load, which is why it doesn't work again later.

In your plugin code, you will want to listen for specific inline edit events. Check this documentation for the most up-to-date info, and some examples of how to listen for the appropriate event: https://developer.atlassian.com/server/jira/platform/extending-inline-edit-for-jira-plugins/

Hope that helps!

Daz

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events