Inside Oracle APEX by Patrick Wolf

Add Double Click to Oracle APEX Shuttle Widget

Do you want to improve the usability of the Oracle APEX Shuttle Widget a little bit?

Let's enhance it by adding support for double click. It will allow users to double click on an entry in one of the two lists of the shuttle, to move the selected entry to the other list as they would normally do with the corresponding icons. I think that's a little bit more convenient and faster than using the icons.

There comes the necessary code.
  1. Create a Page Item of type "Shuttle"
  2. Add the following code into the "Post Element Text" property of that page item.
    <script type="text/javascript">
    (function(){
    var vName = "#CURRENT_FORM_ELEMENT#".substr(2);
    $x("#CURRENT_ITEM_NAME#").ondblclick = new Function("g_Shuttlep_"+vName+".remove();");
    $x("#CURRENT_ITEM_NAME#_2").ondblclick = new Function("g_Shuttlep_"+vName+".move();");
    })();
    </script>
  3. That's it, you are done. Quite simple and easy, isn't it?
I already tried to influence Carl a little bit to add that small little feature to Oracle APEX 3.1, let's see if I was successful :-)

Labels: , , ,

7 Comments:

Post a Comment

<< Home