Single Article

APEX and shuttle filter

Category APEX and jQuery

Here is small tip how to create filter / search field for APEX shuttle item values.
For this you need just place jQuery code to page JavaScript Function and Global Variable Declaration:

  return this.each(function(i){
   var $self      = $(this)
   ,filterId      = $self.attr("id") + "_FILTER"
   ,$select       = $self.find("select")
   ,shuttleValues = $select.children("option").map(function(){
    return {text:$(this).text(),value:$(this).val(),option:this}
   ,$filter = $("<input/>",{"type":"text","value":"","size":"255","autocomplete":"off","id":filterId})
    var filterval   = new RegExp("^"+$(this).val()+".*","i")
,selectedValues = $select.eq(1).children("option").map(function(){
     return $(this).val();
     if(obj["text"].match(filterval) && $.inArray(obj["value"],selectedValues)<0){

Then add to page JavaScript Execute when Page Loads


Replace Px_SHUTTLE_ITEM_NAME with your real shuttle item name.

See working example.

Shuttle with filter


  • Jari Laine · 18 Mar 2018  

    Hi ashish,

    Sorry, can't help. I don't have time to start guess what is problem.

    Regards, Jari

  • ashish · 17 Mar 2018  

    Hi Jari

    I've tried to implement two shuttle on page with this filter code. one shuttle is load on the result of other shuttle selected records . So on page load one shuttle is with records and other is without records loaded , the shuttle without record or which is loaded on first shuttle result, that's filter is not working. Please try this and help me out.

  • HARTi · 7 Feb 2018  

    Hi Jari,

    Thanks for the quick reply ... works great.



  • Jari Laine · 7 Feb 2018  

    Hi HARTi,

    You need change JavaScript placed to page JavaScript Function and Global Variable Declaration
    Find below line (line number 13)

    var filterval = new RegExp("^"+$(this).val()+".*","i")

    And replace that with

    var filterval = new RegExp($(this).val(),"i")


  • HARTi · 7 Feb 2018  

    Hi Jari,

    can you please tell me what I need to change in your code for the result to look like

    WHERE city like '%filter%'

    and not like

    WHERE city like 'filter%'.

    So I want to get results that have the search-string not just at the beginning of the word, but also in the middle or at the end.

    Thank you in advance

  • Jari Laine · 27 Dec 2017  

    Hi ashish,

    It is impossible help as I don`t know anything about your application.


  • ashish · 26 Dec 2017  

    Hi Jari,

    i'm created an application,in which i've applied this code,it was working fine before but now filter disappear even code is still there.i've tried this code in another page, it was working there.Can you help me out why it is happening?

  • Jari Laine · 13 Dec 2017  

    Hi ashish,

    I did just tested that example works for multiple shuttle items on same page. 


  • ashish · 12 Dec 2017  

    Hi Jari

    Thanks for the quick reply, but i've used this code for two different shuttle on same row, so they are not working as well.In short if i am using more than one shuttle on the same page these are all not working with the same code. It will be helpful if any suggestion from your side.



  • Jari Laine · 11 Dec 2017  

    Hi ashish,

    Example works also on APEX 5.0.x.



Global Right Column



Subscribe in a Reader