This discussion is archived
10 Replies Latest reply: Dec 7, 2012 11:25 AM by VC RSS

Hide the 'Show All' option in Region Selector

ryansun Newbie
Currently Being Moderated
Hi there,

I just searched this forum and came to know that we can hide the show all option in region selector using jQuery as suggested by VC.

$('ul[id$="_RDS"]').children('li').each(function(i, e){
if ($(e).text()=='My Tab') {
$(e).find('a').click();
}
});


Any idea where this jQuery needs to be inserted?

thanks.
Sun
  • 1. Re: Hide the 'Show All' option in Region Selector
    VC Guru
    Currently Being Moderated
    Wrap it inside
    $(document).ready(function() {
      // code here
    });
    You can add to Edit page > page header > Execute when Page Loads

    OR

    Edit your page > create a dynamic action > Event (Page Load) > click next >action (Execute javascript code) >In Code add below code > click next > Create
  • 2. Re: Hide the 'Show All' option in Region Selector
    ryansun Newbie
    Currently Being Moderated
    Hi VC,

    I tried the Dynamic Action thing and pasted this

    $(document).ready(function() {
    $('ul[id$="_RDS"]').children('li').each(function(i, e){
    if ($(e).text()=='My Tab') {
    $(e).find('a').click();
    }
    });
    });





    Still shows the Show ALL.

    Thanks,
    Sun
  • 3. Re: Hide the 'Show All' option in Region Selector
    VC Guru
    Currently Being Moderated
    sun1977 wrote:
    Hi VC,

    I tried the Dynamic Action thing and pasted this

    $(document).ready(function() {
    $('ul[id$="_RDS"]').children('li').each(function(i, e){
    if ($(e).text()=='My Tab') {
    $(e).find('a').click();
    }
    });
    });
    Hi Sun,

    First look at the code and understand what it does before using.

    You need to replace the My Tab with Show All
     $(document).ready(function() {
       $('ul[id$="_RDS"]').children('li').each(function(i, e){
       if ($(e).text()=='Show All') {
       $(e).find('a').click();
       }
       });
     });
  • 4. Re: Hide the 'Show All' option in Region Selector
    ryansun Newbie
    Currently Being Moderated
    Hi VC, This Jquery thing was my first attempt, considering how cryptic it looks, I though the My Tab, must be some sort of an identifier. I did change it to "Show All" but no luck.
  • 5. Re: Hide the 'Show All' option in Region Selector
    VC Guru
    Currently Being Moderated
    No worries!

    Can you copy the html from view source?
  • 6. Re: Hide the 'Show All' option in Region Selector
    VC Guru
    Currently Being Moderated
    don't forget to put the code inside {noformat}
     
    {noformat}
  • 7. Re: Hide the 'Show All' option in Region Selector
    ryansun Newbie
    Currently Being Moderated
    Hi VC,
    <table class="tbl-body" cellspacing="0" cellpadding="0" border="0" summary="">
        <tbody>
          <tr>
            <td class="tbl-main" width="100%"><div class="apex-rds-container"><ul id="3388023453317532_RDS" class="apex-rds"><li class="apex-rds-first apex-rds-selected"><a href="#SHOW_ALL"><span>Show All</span></a></li><li><a href="#R3065313453780541"><span> MASTER DATA</span></a></li><li class="apex-rds-last"><a href="#R3375830763272358"><span>Edit  Data Dump</span></a></li></ul></div><div class="rounded-corner-region" id="R3065313453780541" >
      <div class="rc-gray-top"><div class="rc-gray-top-r">
        <div class="rc-title"> MASTER DATA<a class="eLink" title="Edit" href="javascript:popupURL('f?p=4000:374:132::::P374_ID,FB_FLOW_ID,FB_FLOW_PAGE_ID:30653,129,1');" tabindex="999"><img src="/i/e.gif" alt="Edit" class="eLink" /></a></div>
      </div></div>
      <div class="rc-body"><div class="rc-body-r">
    <div class="rc-content-buttons"><button value="Reset" onclick="apex.submit('RESET');" class="button-default" type="button"  id="B3068426845780551">
      <span>Reset</span>
    Anything specific that you want me to paste? Lots of content in the actual HTML source.

    thanks,
    Sun

    Edited by: sun1977 on May 29, 2012 5:50 AM
  • 8. Re: Hide the 'Show All' option in Region Selector
    VC Guru
    Currently Being Moderated
    Hi Sun,

    This html code is enough for now, Try this and see if it works
    $(document).ready(function() {
       $('ul[id$="_RDS"]').children('li').each(function(i, e){
       if ($(e).find('a').attr("href")=='#SHOW_ALL') {
       $(e).find('a').click();
       }
       });
     });
  • 9. Re: Hide the 'Show All' option in Region Selector
    ryansun Newbie
    Currently Being Moderated
    Hi VC,

    Still does not work. I am going to check, if there are any javascript restrictions that maybe have been put in place by the admins.

    Thanks
  • 10. Re: Hide the 'Show All' option in Region Selector
    VC Guru
    Currently Being Moderated
    Hi Sun,

    My earlier code was right, but it was highlighting the Show All option instead of removing as this code was copied from a different thread.

    This should do...
    $(document).ready(function() {
    $('div.apex-rds-container a[href=#SHOW_ALL]').hide();
     });

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points