Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6726023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:52:38+00:00 2026-05-26T09:52:38+00:00

I am looking to understand how to update a jqGrid table from Fusion Tables

  • 0

I am looking to understand how to update a jqGrid table from Fusion Tables (FT) –

at the moment I can search or scroll on a Google Map, send an event listener that compiles a FT query of the spatial bounds of the viewport/map, to get a new set of results.
I want to use the new FT query string (or could use the Google code to retrieve the data – query.send(getData);) to update the jqGrid table with the new values.

Before I started using jqGrid, I tried/suceeded with the Google Visualisation API, and some of that code is below. Could anyone suggest how to move from table.draw, to loading/reloading a jqGrid table? Thanks a lot in advance.

function tilesLoaded() {
        google.maps.event.clearListeners(map, 'tilesloaded');
        google.maps.event.addListener(map, 'zoom_changed', getSpatialQuery);
        google.maps.event.addListener(map, 'dragend', getSpatialQuery);
        getSpatialQuery();  
    }   

    function getSpatialQuery() {
      sw = map.getBounds().getSouthWest();
      ne = map.getBounds().getNorthEast();
      var spatialQuery = "ST_INTERSECTS(latitude, RECTANGLE(LATLNG(" + sw.lat() + "," + sw.lng() + "), LATLNG(" + ne.lat() + "," + ne.lng() + ")))";

      changeDataTable(spatialQuery);
    }

function changeDataTable(spatialQuery) {
  var whereClause = "";
  if(spatialQuery) {
    whereClause =  " WHERE " + spatialQuery;
  }
  var queryText = encodeURIComponent("SELECT 'latitude', 'longitude', 'name' FROM xxxxxxxx" + whereClause + " LIMIT 50");
  var query = new google.visualization.Query('http://www.google.com/fusiontables/gvizdata?tq='  + queryText);
  query.send(getData);
}

function getData(response) {
  var table = new google.visualization.Table(document.getElementById('visualization'));
  table.draw(response.getDataTable(), {showRowNumber: true});
}

Oh, and I used Oleg’s code jqGrid returns blank cells as a basis for just seeing if I could get a simple multi-select table to pull data from my FT – that worked fine with the simple mod of

url: ‘http://www.google.com/fusiontables/api/query?sql=‘ +

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:52:38+00:00Added an answer on May 26, 2026 at 9:52 am

    In case this helps someone, I’ve taken some of the code I came up with and pasted it below:

    // You can get the map bounds via then pass it via a function (below is hacked from several functions
    sw = map.getBounds().getSouthWest();
    ne = map.getBounds().getNorthEast();
    var whereClause = "ST_INTERSECTS(latitude, RECTANGLE(LATLNG(" + sw.lat() + "," + sw.lng() + "), LATLNG(" + ne.lat() + "," + ne.lng() + ")))";
    
    //construct the URL to get the JSON
    var queryUrlHead = 'http://www.google.com/fusiontables/api/query?sql=';
    var queryUrlTail = '&jsonCallback=?'; // 
    var queryOrderBy = ' ORDER BY \'name\' ASC';
    var queryMain = "SELECT * FROM " + tableid + whereClause + queryOrderBy + " LIMIT 100";
    var queryurl = encodeURI(queryUrlHead + queryMain + queryUrlTail);
    
    //use the constructed URL to update the jqGrid table - this is the part that I didn't know in my above question
    $("#gridTable").setGridParam({url:queryurl});
    $("#gridTable").jqGrid('setGridParam',{datatype:'jsonp'}).trigger('reloadGrid');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a student looking for resources which can help me further understand how to
I'm looking for a better solution for two things: How can I understand if
I was looking at the first table on http://zero.milosz.ca/ , and wanted to understand
I am looking into authenticating via google. I dont understand how it works: http://code.google.com/apis/accounts/docs/OpenID.html#Samples
I am looking at how to update a specific table depending on whether the
I'm looking for a way to create a simple HTML table that can be
I understand how to receive and send data from an android app to a
I understand that ClickOnce applications can update automatically. However, the options offered by Microsoft
I'm looking to update our project's jaxb version from 1 to 2. Has anyone
I don't quite understand RDF, but I am looking to convert RSS feeds from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.