EXCEL dependent dropdown list - javascript

I'm trying to make a dependent dropdown list with excel or with html.
I got the following problem with html: Changing href by value
But my problem with excel is when i have made the dependent drop down list, i try to get it to html but it just shows a table of content listed. Not a dependent dropdown list.
I mean by this thats you can't select values from a list, but it just shows a table of everything you put in to it. Does someone have any information about converting dependent dropdown lists to code?
I can't find anything on the internet..
Or does someone have knowledge about dependent dropdown lists? I would really like to hear from you!

Related

How would I implement a cascading dropdown list that reads from multiple sql tables? C# MVC

I'm building an mvc web app using C#. The place I am currently stuck is trying to add a cascading drop-down list. I have seen several articles on this, however my usage varies enough that I'm not sure how to implement it.
My information to populate the dropdown lists is coming from a series of sql tables. The first dropdown should show the information from one table (which lists available tables). When the user selects an option, a second dropdown list should be created and filled with the information from the chosen table.
How would I implement this cascading dropdown list which could read from any number of different tables?
I believe this will involve AJAX/javascript which I'm not very familiar with.
To better explain my data structure, this is an application for an administrator to keep track of useful information. There could be several tables such as Employees, CompaniesWorkedWith, ProjectsBeingDeveloped, BudgetItems, etc... Then a final lookup table that would contain these table names. The first dropdown would be populated with information from this lookup table. Then when the user selects an item (such as Employee) the second dropdown would grab the information from the appropriate table and display it in a dropdown. Then the user could select and item (such as an individual employee) which will then grab the details of that item and present it to the user. That last part should be easy. I'm just confused on how to get the dropdowns to cascade through multiple tables. It should be dynamic that someone can easily go in and add another table to the lookup table and have it function properly.
You need to implement callback's to update the data sources for the cascaded controls. Just use your update panels appropriately to prevent full page post-backs. If you're using a framework such as DevExpress, Telerik or ASP.NET then there's lots of options and sample source code for this exact thing.
http://www.codeproject.com/Articles/730953/Cascading-Dropdown-List-With-MVC-LINQ-to-SQL-and-A
EDIT: I realized you're second data-source depends on a second more dynamic data source. To do this I would create my own data-source implmenting IEnumerable. I have a sample of something that may help somewhere... I'll look for it.
EDIT 2:
Okay, I took a look at code similar to this (not quite the same) but here's how you can do it:
You'll need a generic container for your values for your second/third/etc. dropdown lists. This might be a List<string> or a List<MyGenericClass> with whatever properties you are filling out to represent your columns for each row in the dropdown.
Use SqlConnection, SqlCommand to iterate through the results and populate the List (or your own class that implements IEnumerable).
Assign the IEnumerable object to your dropdown list datasource.

Dynamically loaded items not shown in second time on dropdown (Harvesthq Chosen)

I'm using this following tool to make the dropdown searchable and look nice.
Harvesthq Chosen
First I'm loading the data dynamically in dropdown and applying this code to apply the effect.
$(".chosen-select").chosen();
It works just fine. Everything ok. Then depending on some option I want to empty all data and insert new options. Now problems occur. The newly added options are not shown. Old options are still visible.
So I checked with the firebug. Select tag contains my desired data, but it's showing wrong data(Old ones).Some kind of div is visible. I tried to apply the chosen methd once again. But not working. Then I tried
$("#form_field").trigger("chosen:updated");
And not working either. Can anybody tell me what is missing?
I want to clear and load data dynamically multiple times in dropdown and apply the chosen effect.
This worked for me
$("#form_field").trigger("liszt:updated");

html dropdown menu populated by mysql after selection load another dropdown menu

I'm using PHP to pull from a MySQL table then populate an XML for the javascript to get that information.
Table results example shown here
I want to make a dropdown menu the the hobbienames then when that selection is made another menu to appear with the hsnames that match the hobbiename. obviously if null nothing will appear.
If the first dropdown is not very lengthy, and has a fixed length, then you can retrieve all the possible dropdowns and hide them initially.. On selection of an item from dropdown1 you can then display its corresponding dropdown.
In the other case, if the first dropdown is lengthy, then on its selection, run an AJAX function which will eventually populate the other dropdown.
Here's a sample code which you can use as reference...
http://theitbranch.com/transfer/country.zip

Using Dashcode's List Controller without their DataSource option

I'm working on my own custom google calendar, so far i'm able to get everything to work, i've loaded all the data and everything works great, each event shows up on a select box.
What i want to do now is to load each event name on the LIST part. How exactly can i do that? i'm very lost with it.
I looked at the sample code that dashcode has for the list part but i really am lost with populating the list in real time, can somebody help me? i can provide more info as needed, thanks!
In dashcode under library/code there is an example titled 'List Data Source'. You will also need to alter the list object datatype to dynamic and then select your datasource from the dropdown list.

Recursive Drop Down Image Selection?

I'm trying to create a product page layout that allows a customization of a product. Basically, a series of drop downs with each successive drop down populated with options based on what has been selected so far. So like this:
Drop down 1: Product Variant (user selects productvariationb, drop down 2 then is populated with options for productvariationb).
Drop down 2: Product color (user selected productvariationb in drop down 1, now that they select "brown" in drop down 2 the image should change to a brown version of productvariation b).
And so on, with the image changing (and options populating) each time according to what has been selected.
Can I do this with JS and does anyone know of a script similar that I can edit, or what functions of JS I need to look into to accomplish this?
Here I made you this : http://jsfiddle.net/moeishaa/H9fF2/
It is working with jQuery. Play with it and let me know if this helped :-)
I know it looks very static but you can render the drop-down on page load and populate the options object as well. I am sure you can find plug in and add-ons. This is a very short amount of code and can be customized.
I think the best resource for example code would be looking at some JavaScript or JQuery examples on creating expandable menus (more specifically ones that mimic folder structures). They usually operate by decorating an unordered list.
You could create a static unordered list and have the image change based on what item you are hovering over. Alternatively, you could use some AJAX to dynamically populate additional parts of the list as you hover over different levels. Both of those would most likely be easily accomplished with JQuery. Here's a page with some menu examples that might give you some ideas:
JQuery Navigation Menus

Categories