问题
I decided the reformulate the question I asked here into a simpler way.
Is there any way to populate the left hand side of a shuttle dynamically in Oracle Apex ?
I wrote a PL/SQL process that calculates the list of values I want to use for the left side of my shuttle, but I can't manage to append it to it. The calculus is based on a select list item P1_MY_LIST
just before the shuttle. The process is triggered when a change happens on that select list.
For now I tried : :P1_MY_SHUTTLE := list_of_values
but it obviously populates the shuttle's right side.
Any suggestion on how to do so ? I'm using Apex 19.1
回答1:
so I played around with shuttles a bit and here is what I came up with.
var left = $("#P1_MY_SHUTTLE ")[0].children[0].children[0].children[0].children[0].children[0]
var right = $("#P1_MY_SHUTTLE ")[0].children[0].children[0].children[0].children[2].children[0]
These two should mark out the left and right panes of the shuttle. Then what you need is
left.appendChild()
But you cannot just append 'Something' You could play around with this stuff some more and figure out how to correctly add it, it probably means creating a new var with the constructor or something, I dont know.
But a hack for this is
left.appendChild(right.children[0])
Which just moves the first element on the right side to the right. Meaning you can add stuff to the right and move it to the left.
You could also do some code that adds something to the right side, then go through all the options on the right and find which one you just added, and then move it to the left.
Obviously this isnt an elegant solution, hell it might not even work well. But its a start, so now that you have a start you can play around in the console some more and hopefully figure out a perfect solution for your problem.
来源:https://stackoverflow.com/questions/62550312/how-to-populate-left-side-of-shuttle-in-oracle-apex