Query page of Google spreadsheet

I have the following Google spreadsheet query page:

http://futurehoustonsupport.com/query44.html

Right now the drop downs work to filter the spreadsheet but each filter re-filters the spreadsheet totally. But I need for each filter to filter the results of the previous filter.

I also need a way to refresh all the filters and return the table to the original state.

You can see all the code in the page by viewing the source.

Thx
Oscar9ertangoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

leakim971PluritechnicianCommented:
replace :
    function setQuery(queryString) {
      // Query language examples configured with the UI
      query.setQuery(queryString);
      sendAndDraw();
      queryInput.value = queryString;
    }

Open in new window


by :
    function setQuery() {

        var dropdown1 = document.getElementById("query-3");
        var dropdown2 = document.getElementById("query-4");
        var dropdown3 = document.getElementById("query-5");
        var dropdown4 = document.getElementById("query-6");

        var filter1 = dropdown1.options[dropdown1.selectedIndex].value.replace("where","");
        var filter2 = dropdown2.options[dropdown2.selectedIndex].value.replace("where","");
        var filter3 = dropdown3.options[dropdown3.selectedIndex].value.replace("where","");
        var filter4 = dropdown4.options[dropdown4.selectedIndex].value.replace("where","");

        var filters = [];
        if(filter1!="") filters.push(filter1);
        if(filter2!="") filters.push(filter2);
        if(filter3!="") filters.push(filter3);
        if(filter4!="") filters.push(filter4);
        queryString = "where " + filters.join(" and ");

        // Query language examples configured with the UI
        query.setQuery(queryString);
        sendAndDraw();
        queryInput.value = queryString;
    }

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Oscar9ertangoAuthor Commented:
Works perfectly! Thx
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.