manna / fusiontableslayer-builder

Automatically exported from code.google.com/p/fusiontableslayer-builder
0 stars 0 forks source link

"show all" feature to reset filter #33

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Have a look at gfmap.com. It would be great if there could be a show all on the 
filter up the top, so that once a user has filtered they can go back to see 
everything. I've had a dig around but I do not know how to enable it myself.

Thanks

mattmartel@gmail.com

Original issue reported on code.google.com by mattmar...@gmail.com on 6 May 2012 at 12:23

GoogleCodeExporter commented 9 years ago
I double this request, it's quite bad that after I filter one option I cannot 
go back

thank you! 

Original comment by jalab...@gmail.com on 11 Oct 2012 at 2:07

GoogleCodeExporter commented 9 years ago

Original comment by rshap...@google.com on 18 Oct 2012 at 10:35

GoogleCodeExporter commented 9 years ago
I triple this request

Original comment by bluffdal...@gmail.com on 14 Dec 2012 at 7:01

GoogleCodeExporter commented 9 years ago
I managed to find a workaround by doing something like this example below.
Basically, it will do an IF SearchString has a Value, then do the original 
query code, ELSE then it will simply show all

--------- HIGH LEVEL ----------
from:
[original code]

I edited it to:
if(searchString){
[original code]
}
else
{[original code] but minus the search query
}

--------- SAMPLE CODE ----------

    function changeMapl0() {
      var searchString = document.getElementById('search-string-l0').value.replace(/'/g, "\\'");
      if(searchString)
      {
      layerl0.setOptions({
        query: {
          select: "'col9'",
          from: '1DPt-0Nd4SORHIdW6_T_If67brMmWBfKh8sp1X_E',
          where: "'SearchColumn' = '" + searchString + "'"
        }
      });
      }
      else
      {
        layer.setOptions({
          query: {
            select: locationColumn,
            from: tableId  }
      });
      }

    }

Original comment by rafaelau...@gmail.com on 5 Apr 2013 at 12:21

GoogleCodeExporter commented 9 years ago
I tried implementing this workaround, but it didn't work.  I tried it as is, 
then replaced locationcolumn and tableid with the values for my table and it 
didn't work either.
I don't understand how the code that follows else is supposed to make it show 
all...

Original comment by Hamilton...@gmail.com on 9 May 2013 at 8:11

GoogleCodeExporter commented 9 years ago
Found a work-around.

In the definitions of the changemap function, add the following after var 
searchString=.....

    var whereQuery = "'Category' = '" + searchString + "'";
    if (searchString == "All") whereQuery = "";

Then add an "All" option into your select lists with the following:
<option value="All">All</option>

You can also put a Hide All by using the following:
<option value="">Hide All Actions</option>

This tells it to search for and display something that doesn't exist (assuming 
you don't have any empty cells in the column you're searching) and so it will 
essentially hide everything

Original comment by Hamilton...@gmail.com on 23 May 2013 at 8:38