That is bizarre. Try building a new spreadsheet with the same data (do it manually, don't copy-paste), and see if you get the same effect. Other spreadsheet queries are not displaying the same issue, so I assume there is something wonky with your spreadsheet itself.
On Saturday, August 10, 2013 3:15:11 PM UTC-4, BuildingtheNextGen wrote: > > No, the spreadsheet seems to be fine. The headers are on the first row and > everything else underneath in separate rows. However, when I view in using > the script, that's when it gets distorted. I can't identify any reason. > Here's the code again: > > > <form id="form1" method="post" action ="/index.php"> <label> > <input id="search" name="search" type="text" /> > </label> > <label> > <input type="submit" /> > </label> > > > </form> > <p> > > > > > <script type="text/javascript" src="http://www.google.com/jsapi"></script> > <script type="text/javascript"> > google.load('visualization', '1', {packages: ['table']}); > </script> > <script type="text/javascript"> > > > function drawVisualization() { > var query = new google.visualization.Query( > ' > https://docs.google.com/spreadsheet/pub?key=0AmOkf3tfSbwedG9hWi1QTHFsWjE4NzdDcWtCMEtJbEE&single=true&gid=0&output=html' > ); > > > query.setQuery('SELECT A, B, C, D, E where upper(A) like upper("%%") or > upper(B) like upper("%%") or C like "%%" or upper(D) like upper("%%") or > upper(E) like upper("%%")order by A asc'); > query.send(handleQueryResponse); > } > function handleQueryResponse(response) { > if (response.isError()) { > alert('Error in query: ' + response.getMessage() + ' ' + > response.getDetailedMessage()); > return; > } > var data = response.getDataTable(); > var formatter = new google.visualization.PatternFormat('<a href="{0}" > target="_blank">{0}</a>'); > formatter.format(data, [4]); > visualization = new > google.visualization.Table(document.getElementById('table')); > visualization.draw(data, {allowHtml: true, legend: 'bottom'}); > } > google.load('visualization', '1', {packages:['table'], callback: > drawVisualization}); > </script> > > > <div id="table"></div> > > > </div> > > > On Sat, Aug 10, 2013 at 12:07 PM, asgallant > <[email protected]<javascript:> > > wrote: > >> Is the merge problem in the spreadsheet or just when you query? >> >> >> On Saturday, August 10, 2013 9:54:22 AM UTC-4, BuildingtheNextGen wrote: >> >>> I'm sorry to bother you again, but I'm having some sort of problem >>> again. For some reason, the site is no longer updating the spreadsheet and >>> won't search. I didn't really do anything to the script, so not sure what >>> the problem is. As I add to the spreadsheet, the title row is getting >>> combined with multiple rows on the site (In other words, the Title row 1 of >>> the spreadsheet may show as merged with Rows 1, 2, 3, and 4. I'm not sure >>> why it's doing that. Any thoughts? >>> >>> >>> On Thu, Aug 8, 2013 at 7:14 PM, asgallant <[email protected]>wrote: >>> >>>> You're welcome. >>>> >>>> >>>> On Thursday, August 8, 2013 6:56:38 PM UTC-4, BuildingtheNextGen wrote: >>>>> >>>>> Thanks very much! It looks like it's working. You've just made my life >>>>> easier. >>>>> >>>>> I'll probably try to copy it for another spreadsheet too. Thanks! >>>>> >>>>> On Thursday, August 8, 2013 4:34:19 PM UTC-4, asgallant wrote: >>>>>> >>>>>> Add a target="_blank" parameter to the anchor tag in the formatter: >>>>>> >>>>>> var formatter = new google.visualization.**PatternFo**rmat('<a >>>>>> href="{0}" target="_blank">{0}****</a>'); >>>>>> >>>>>> On Thursday, August 8, 2013 3:39:19 PM UTC-4, BuildingtheNextGen >>>>>> wrote: >>>>>>> >>>>>>> Wow! You are great! I have been trying to get this resolved for a >>>>>>> few days and you are making my life easy. :) >>>>>>> >>>>>>> It looks like I got everything to work, but found one other issue. I >>>>>>> noticed that all of the links open up in the same window. Is there an >>>>>>> easy >>>>>>> enough way to have the links open the file in another window? >>>>>>> >>>>>>> On Thursday, August 8, 2013 1:49:41 PM UTC-4, asgallant wrote: >>>>>>>> >>>>>>>> Some of the URL's in the spreadsheet aren't formatted correctly >>>>>>>> (eg, "www.google.com" is missing the "http://" piece, and the >>>>>>>> "click me" entry will probably throw a 404 error). >>>>>>>> >>>>>>>> As far as the search goes, check to make sure your query string is >>>>>>>> correct. I copied the string from your rendered javascript, not the >>>>>>>> pre-rendered PHP, so if you copied my code exactly, you are probably >>>>>>>> missing that part. >>>>>>>> >>>>>>>> On Thursday, August 8, 2013 12:58:00 PM UTC-4, BuildingtheNextGen >>>>>>>> wrote: >>>>>>>>> >>>>>>>>> Also, it looks like the search function doesn't work any more >>>>>>>>> either. Did I copy of the code wrong? >>>>>>>>> >>>>>>>>> On Thursday, August 8, 2013 12:31:57 PM UTC-4, BuildingtheNextGen >>>>>>>>> wrote: >>>>>>>>>> >>>>>>>>>> Oh man, we were getting so close & you would be a life saver. :) >>>>>>>>>> I can now click on the link, but unfortunately, it's not directing >>>>>>>>>> it to >>>>>>>>>> the site. Instead, it's adding it on to the domain instead of >>>>>>>>>> opening up >>>>>>>>>> the URL on it's own. Any thoughts to resolve that? >>>>>>>>>> >>>>>>>>>> Again, thanks so much for the help with this. >>>>>>>>>> >>>>>>>>>> On Wednesday, August 7, 2013 11:34:10 PM UTC-4, asgallant wrote: >>>>>>>>>>> >>>>>>>>>>> There are a few errors you need to fix: >>>>>>>>>>> >>>>>>>>>>> 1) you are missing the "function drawVisualization ()" >>>>>>>>>>> descriptor before the start of the function call >>>>>>>>>>> 2) you created a formatter, but didn't use it to format >>>>>>>>>>> anything. Also, with the format specified, it won't create links >>>>>>>>>>> that go >>>>>>>>>>> anywhere. >>>>>>>>>>> 3) you have a table.draw call that shouldn't be there >>>>>>>>>>> >>>>>>>>>>> I fixed these for you and did a mockup here: >>>>>>>>>>> http://jsfiddle.net/asgallant/****SGfEu/<http://jsfiddle.net/asgallant/SGfEu/> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> On Wednesday, August 7, 2013 8:41:47 PM UTC-4, >>>>>>>>>>> BuildingtheNextGen wrote: >>>>>>>>>>>> >>>>>>>>>>>> Thanks for the response. Here's the page source: >>>>>>>>>>>> >>>>>>>>>>>> <form id="form1" method="post" action ="/index.php"> <label><input >>>>>>>>>>>> id="search" name="search" type="text" /></label><label><input >>>>>>>>>>>> type="submit" /></label></form><p><script type="text/javascript" >>>>>>>>>>>> src="http://www.google.com/**jsa**pi"></script><script >>>>>>>>>>>> type="text/javascript">google.load('visualization', '1', >>>>>>>>>>>> {packages: ['table']});</script><script >>>>>>>>>>>> type="text/javascript">{var query = new >>>>>>>>>>>> google.visualization.Query('https://docs.google.com/**sprea**dsheet/ccc?key=**0AmOkf3tfSbwedH**VmN2FPdUo2Mk9pU**kNMQzlhd0F4OHc#**gid=0' >>>>>>>>>>>> >>>>>>>>>>>> <https://docs.google.com/spreadsheet/ccc?key=0AmOkf3tfSbwedHVmN2FPdUo2Mk9pUkNMQzlhd0F4OHc#gid=0'>);query.setQuery('SELECT >>>>>>>>>>>> A, B, C, D, E where upper(A) like upper("%%") or upper(B) like >>>>>>>>>>>> upper("%%") or C like "%%" or upper(D) like upper("%%") or >>>>>>>>>>>> upper(E) like upper("%%")order by A >>>>>>>>>>>> asc');query.send(**handleQueryResponse**);}function >>>>>>>>>>>> handleQueryResponse(response) {if (response.isError()) >>>>>>>>>>>> {alert('Error in query: ' + response.getMessage() + ' ' + >>>>>>>>>>>> response.getDetailedMessage())****;return;}var formatter = new >>>>>>>>>>>> google.visualization.**PatternFo**rmat('<a href="#">{0}</a>');var >>>>>>>>>>>> data = response.getDataTable();visualization = new >>>>>>>>>>>> google.visualization.Table(**doc**ument.getElementById('**table'))**;visualization.draw(data, >>>>>>>>>>>> {allowHtml: true, legend: 'bottom'});table.draw(view, {allowHtml: >>>>>>>>>>>> true})}google.setOnLoadCallback(**drawV**isualization);</script><div >>>>>>>>>>>> id="table"></div></div> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> On Wednesday, August 7, 2013 7:52:43 PM UTC-4, asgallant wrote: >>>>>>>>>>>>> >>>>>>>>>>>>> You have used the option correctly, so my guess is that the >>>>>>>>>>>>> data being retrieved from the spreadsheet isn't formatted >>>>>>>>>>>>> correctly. Could >>>>>>>>>>>>> you share a link to the page or post the javascript rendered in a >>>>>>>>>>>>> browser >>>>>>>>>>>>> (open the page in a browser, view the source, and copy the >>>>>>>>>>>>> javascript) so I >>>>>>>>>>>>> can test it? >>>>>>>>>>>>> >>>>>>>>>>>>> On Wednesday, August 7, 2013 7:43:58 PM UTC-4, >>>>>>>>>>>>> BuildingtheNextGen wrote: >>>>>>>>>>>>>> >>>>>>>>>>>>>> I'll begin by saying that I know very, very little about >>>>>>>>>>>>>> coding at all. I was hoping to get a google spreadsheet in a >>>>>>>>>>>>>> searchable >>>>>>>>>>>>>> format that will display only the records related to the keyword >>>>>>>>>>>>>> search. I >>>>>>>>>>>>>> found a great blog post that helped to explain this. I was able >>>>>>>>>>>>>> to get the >>>>>>>>>>>>>> searchable database. It shows all of the columns on my google >>>>>>>>>>>>>> spreadsheet. >>>>>>>>>>>>>> However, I have one column with a bunch of URLs. In the google >>>>>>>>>>>>>> spreadsheet >>>>>>>>>>>>>> itself, it displays with the active links. However, when I use >>>>>>>>>>>>>> the script, >>>>>>>>>>>>>> it only displays the text (whether I have the actual URL there >>>>>>>>>>>>>> or the text >>>>>>>>>>>>>> with the link to the URL). I saw in another post that I needed >>>>>>>>>>>>>> to be sure >>>>>>>>>>>>>> to enter allowHtml: true (case sensitive). However, it does not >>>>>>>>>>>>>> seem to >>>>>>>>>>>>>> work. >>>>>>>>>>>>>> >>>>>>>>>>>>>> Does anyone happen to know how to resolve this issue? Below >>>>>>>>>>>>>> is what I have for that portion of the coding (Again, I know >>>>>>>>>>>>>> very little of >>>>>>>>>>>>>> coding. I just copied the entire code & inserted the link to the >>>>>>>>>>>>>> google >>>>>>>>>>>>>> spreadsheet). Thanks in advance! >>>>>>>>>>>>>> >>>>>>>>>>>>>> <form id="form1" method="post" action ="<?php echo >>>>>>>>>>>>>> $_SERVER['PHP_SELF']; ?>"> <label> >>>>>>>>>>>>>> <input id="search" name="search" type="text" /> >>>>>>>>>>>>>> </label> >>>>>>>>>>>>>> <label> >>>>>>>>>>>>>> <input type="submit" /> >>>>>>>>>>>>>> </label> >>>>>>>>>>>>>> >>>>>>>>>>>>>> </form> >>>>>>>>>>>>>> <p> >>>>>>>>>>>>>> >>>>>>>>>>>>>> <?php >>>>>>>>>>>>>> $search= $_REQUEST['search']; >>>>>>>>>>>>>> if ($search > ''){ $search = $search;} else { $search = '';} >>>>>>>>>>>>>> ?> >>>>>>>>>>>>>> >>>>>>>>>>>>>> <script type="text/javascript" src="http://www.google.com/** >>>>>>>>>>>>>> jsa**pi <http://www.google.com/jsapi>"></script> >>>>>>>>>>>>>> <script type="text/javascript"> >>>>>>>>>>>>>> google.load('visualization', '1', {packages: ['table']}); >>>>>>>>>>>>>> </script> >>>>>>>>>>>>>> <script type="text/javascript"> >>>>>>>>>>>>>> >>>>>>>>>>>>>> { >>>>>>>>>>>>>> >>>>>>>>>>>>>> var query = new google.visualization.Query( >>>>>>>>>>>>>> 'GOOGLE URL GOES HERE'); >>>>>>>>>>>>>> >>>>>>>>>>>>>> query.setQuery('SELECT A, B, C, D, E where upper(A) like >>>>>>>>>>>>>> upper("%<?php echo $search; ?>%") or upper(B) like upper("%<?php >>>>>>>>>>>>>> echo >>>>>>>>>>>>>> $search; ?>%") or C like "%<?php echo $search; ?>%" or upper(D) >>>>>>>>>>>>>> like >>>>>>>>>>>>>> upper("%<?php echo $search; ?>%") or upper(E) like upper("%<?php >>>>>>>>>>>>>> echo >>>>>>>>>>>>>> $search; ?>%")order by A asc'); >>>>>>>>>>>>>> >>>>>>>>>>>>>> query.send(**handleQueryResponse**); >>>>>>>>>>>>>> } >>>>>>>>>>>>>> >>>>>>>>>>>>>> function handleQueryResponse(response) { >>>>>>>>>>>>>> if (response.isError()) { >>>>>>>>>>>>>> alert('Error in query: ' + response.getMessage() + ' ' + >>>>>>>>>>>>>> response.getDetailedMessage())****; >>>>>>>>>>>>>> return; >>>>>>>>>>>>>> } >>>>>>>>>>>>>> >>>>>>>>>>>>>> var data = response.getDataTable(); >>>>>>>>>>>>>> >>>>>>>>>>>>>> visualization = new google.visualization.Table(**doc** >>>>>>>>>>>>>> ument.getElementById('**table'))**; >>>>>>>>>>>>>> visualization.draw(data, {allowHtml: true, legend: 'bottom'}); >>>>>>>>>>>>>> >>>>>>>>>>>>>> } >>>>>>>>>>>>>> >>>>>>>>>>>>>> google.setOnLoadCallback(**drawV**isualization); >>>>>>>>>>>>>> </script> >>>>>>>>>>>>>> >>>>>>>>>>>>>> <div id="table"></div> >>>>>>>>>>>>>> >>>>>>>>>>>>>> </div> >>>>>>>>>>>>>> >>>>>>>>>>>>> -- >>>> You received this message because you are subscribed to a topic in the >>>> Google Groups "Google Visualization API" group. >>>> To unsubscribe from this topic, visit https://groups.google.com/d/** >>>> topic/google-visualization-**api/BTeAMH1UN_s/unsubscribe<https://groups.google.com/d/topic/google-visualization-api/BTeAMH1UN_s/unsubscribe> >>>> . >>>> To unsubscribe from this group and all its topics, send an email to >>>> google-visualization-api+**[email protected]. >>>> To post to this group, send email to google-visua...@**googlegroups.com >>>> . >>>> >>>> Visit this group at http://groups.google.com/** >>>> group/google-visualization-api<http://groups.google.com/group/google-visualization-api> >>>> **. >>>> For more options, visit >>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out> >>>> . >>>> >>>> >>>> >>> >>> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "Google Visualization API" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/google-visualization-api/BTeAMH1UN_s/unsubscribe >> . >> To unsubscribe from this group and all its topics, send an email to >> [email protected] <javascript:>. >> To post to this group, send email to >> [email protected]<javascript:> >> . >> Visit this group at >> http://groups.google.com/group/google-visualization-api. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/groups/opt_out.
