I would also like the possibility of adding rows dynamically. Setting a row count doesnt seem to be possible within the GDownoadURL function although the data variable that holds the values of the table is declared globally.
On Nov 20, 11:10 am, p00kie <[EMAIL PROTECTED]> wrote: > Here is the code is question: > > 498 <script src="http://maps.google.com/maps? > file=api&v=2&key=ABQIAAAAbSchg-GF_E4ltZdUUSsjXhR5drh5kbxNwx- > VeLTXnLalFblxnhQi_-FjKARyIKXcrVuPGjkRX4WZjQ" type="text/javascript"></ > script> > 499 <script type="text/javascript" > src="http://www.google.com/jsapi"></script> > 500 <script type="text/javascript"> > 501 google.load("visualization", "1", {packages: > ["table"]}); > 502 google.setOnLoadCallback(drawTable); > 503 function drawTable() { > 504 var data = new > google.visualization.DataTable(); > 505 data.addColumn('string', 'Id'); > 506 data.addColumn('string', 'PI'); > 507 data.addColumn('string', 'Cruise Info'); > 508 data.addColumn('string', 'Date and Time'); > 509 data.addColumn('string', 'Latitude'); > 510 data.addColumn('string', 'Longitude'); > 511 data.addColumn('string', 'Depth'); > 512 data.addColumn('string', 'Name'); > 513 data.addColumn('string', 'Value'); > 514 data.addRows(1); > 515 > 516 // GDownloadUrl("../output/search/ > results.xml", parseXML(data, responseCode)); > 517 function parseXML(data, responseCode) { > 518 if(responseCode == 200) { > 519 xml = GXml.parse(data); > 520 dataId = > xml.documentElement.getElementsByTagName("data_id"); > 521 // alert(dataId[0].childNodes > [0].nodeValue); > 522 id = dataId[0].childNodes > [0].nodeValue; > 523 // for (var i = 0; i < dataId.length; > i++) { > 524 // id = dataId[i].childNodes > [0].nodeValue; > 525 // pi = dataId[i].childNodes > [0].nodeValue; > 526 > 527 // > 528 // } > 529 } else if (responseCode == -1) { > 530 alert("Data request timed out. > Please try later."); > 531 } else { > 532 alert("Request resulted in error. > Check XML file is retrievable."); > 533 } > 534 } > 535 > 536 var x = 5; > 537 data.setCell(0, 0, "5"); > 538 > 539 var table = new google.visualization.Table > (document.getElementById('table_div')); > 540 table.draw(data, {showRowNumber: true}); > 541 } > 542 </script> > 543 > 544 <div id="table_div"></div> > > Would like to know what to do so that this can be prevented. How would > it be possible for the "needed code" to be loaded into the browser. > > On Nov 18, 3:56 pm, VizGuy <[EMAIL PROTECTED]> wrote: > > > This might have something to do with the fact that once the GDownloadURL > > function is back, then onload is called.Maybe some of the needed code is not > > yet loaded to the browser? > > > I need some more info to understand the exact problem, but generally it > > should work. > > > VizGuy > > > On Tue, Nov 18, 2008 at 3:21 PM, p00kie <[EMAIL PROTECTED]> wrote: > > > > I have a table that fills in data via GDownloadURL of an xml file - > > > however, the table comes up blank. Only when I click to sort (asc/ > > > desc) on one of the columns, then the data will appear. Otherwise, I > > > just see a blank table. > > > > Anyone else encounter this problem? > > > > Also.. is it possible to call the function addRows at any time? (ex. > > > in a GDownloadURL function?) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en -~----------~----~----~----~------~----~------~--~---
