• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 172
  • Last Modified:

Hierarchical Drop Down - Slide left or right select list, is there one that uses conventional select list

I know that there are a bunch of CSS, javascript, jQuery, DHTML menus out there and I have a few.  I was just wondering if there are some that use the standard HTML <select><option></option></select> format in a nested dynamic fashion.  Seems like that should be possible using javascript, CSS and maybe AJAX.  It would be nice to use the standard HTML markup if there was a way to make the lower level selections persist and the place the higher order lists in a visually appealing arrangement.
0
sscotti
Asked:
sscotti
  • 3
  • 2
1 Solution
 
Ray PaseurCommented:
Please post a link to a page that illustrates what you are talking about, thanks. ~Ray
0
 
EMB01Commented:
I did this recently.  I created two arrays:

$firstLevel = array();
$secondLevel = array();

Then, after filling them with data, you simply create a function to put them in left floating divs with overflow set to scroll.  This makes them behave like dropdown boxes:

echo '<div style="clear:both;">';
echo '<span style="float:left;margin:10px;margin-left:35px;margin-top:20px;">';
foreach($firstLevel as $key => $val) {
      echo '<div style="padding:10px;">';
      outputstring($key, 'index.php?id='.$i);
      echo '</div>';
      $i++;
}
echo '</div>';

Lastly, you create a second div filled with the contents of an array filtered by the $_GET['id']:

echo '<span style="float:left;margin:10px;margin-left:65px;margin-top:30px;width:300px;height:250px;overflow:scroll;">';
asort($new[strtoupper($c)]);
                  foreach($new[strtoupper($c)] as $val) {
                        //echo '<div style="padding:10px;">';
                        formatoutputstring(outputstring($val, 'pullRep.php?continent='.$c.'&territory='.preg_replace("/\([^\)]+\)/","",$val)));
                        //echo '</div>';
                  }

Sorry for my example, it's kind of complex.  But that's the idea.  You can also do this with AJAX; make your $primaryLevel links make an ajax call to fill the second DIV.  This is pretty easy to do, let me know if you have any questions at all.
0
 
sscottiAuthor Commented:
Thanks EMB01.

Do you have a demo page to show how it works?  Would kind of like to look at it before I embark on coding it for my server.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
EMB01Commented:
This was developed as a flash alternative for mobile devices.  The only way to view it would be to view it on a mobile device or download a firefox plugin that allows you to emulate a mobile device.

If you want to do that, go here (you can't see it if your not mobile):
http://tinyurl.com/3pblwtm
0
 
sscottiAuthor Commented:
Asking for a login.  I have IOS emulator on my Mac.
0
 
EMB01Commented:
Sorry, you must need to register.  I'll just send you a couple screenshots. north america south america
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now