- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2015 08:51 AM
the html is:
<g:ui_element table="u_development_standard" field="u_standard" id="466eef750fd3710060017e4ce1050ee2"></g:ui_element><p></p>
the javascript to GET the value is:
var standardId = gel('u_development_standard.u_standard');
but how do I SET the value?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2015 07:26 PM
If you're starting off with an empty list and you want to add to it, you should also see a "_edit" which you're probably aware of since that is the element that contains your actual glide-list and you needed to change the display value to get it to show. Or at least that's what I get and had to do.
So inside of that you'll see the list is actually a simple select element that if not empty would contain option elements. If you want to add/remove to that then you need to do the same as before and capture it via DOM.
I believe the id for the select element would be something like this "select_0u_development_standard.u_standard".
So document.getElementById('select_0u_development_standard.u_standard') should do it. From there you'll need to create an element and stuff it with the desired data. Then append it to the select element. Something like this:
var selEl = document.getElementById('select_0u_development_standard.u_standard');
var optEl = document.createElement('option');
var txtNd = document.createTextNode([your display value if different from actual value]);
optEl.setAttribute('value', [your actual value. usually the sys_id]);
optEl.appendChild(txtNd);
selEl.appendChild(optEl);
All of those values should correlate to what you already have going on with the previous stuff. Of course you can optimize the code so that you can add multiple at a time. I'll leave that up to you though.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-14-2015 12:52 AM
Fantastic, thanks so much I've pretty much sorted it and that's down to all your help.
Brilliant!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2016 05:38 AM
Could you share a example screenshot of this implementation? To check aspect, design, etc.