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

  • Home
  • SEARCH
  • 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 8440305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:15:26+00:00 2026-06-10T08:15:26+00:00

I have created google Visualization table with server side Data poplation(Json created in PHP

  • 0

I have created google Visualization table with server side Data poplation(Json created in PHP and return to datatable).How to add search filter for this Table? I have seen Sample Code in Visulaization playgroud. It shows using Control Wrapper and Chart Wrapper.So How to apply this control wrapper for my DataTable(Json data returned from PHP)?

function drawmsgtable(users)
    {
        var msgdata = $.ajax({
            url: "http://mysite/phpscripts/msgtable.php?users="+users+"",
            dataType:"json",
            async: false
        }).responseText;
        var messagedatatable = new google.visualization.DataTable(msgdata);

        var options={'backgroundColor': 'transparent', 'width': 'auto'};
        $('#table_div').empty();
        var msgTable = new google.visualization.Table(document.getElementById('table_div'));
        msgTable.draw(messagedatatable, options);
    }
  • 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-06-10T08:15:27+00:00Added an answer on June 10, 2026 at 8:15 am

    First, you need to load the “controls” package

    google.load('visualization', '1', {packages: ['controls']}); 
    

    Then, you need to convert the Table object into a ChartWrapper object, and add a Dashboard object and ControlWrapper object (and HTML div’s to hold them – the Dashboard div should contain both the control and table divs, but it is not strictly necessary to have it so). You bind the control to the table in the dashboard and draw the dashboard

    function drawmsgtable(users) {
        var msgdata = $.ajax({
            url: "http://mysite/phpscripts/msgtable.php?users=" + users + "",
            dataType: "json",
            async: false
        }).responseText;
        var messagedatatable = new google.visualization.DataTable(msgdata);
    
        var options = {
            backgroundColor: 'transparent',
            width: 'auto'
        };
    
        $('#table_div').empty();
    
        var dashboard = new google.visualization.Dashboard(document.getElementById('dash'));
    
        var msgTable = new google.visualization.ChartWrapper({
            chartType: 'Table',
            containerId: 'table_div',
            options: options
        });
    
        var control = new google.visualization.ControlWrapper({
            chartType: 'StringFilter',
            containerId: 'table_div',
            options: {
                 filterColumnIndex: 0
            }
        });
    
        dashboard.bind([control], [msgTable]);
        dashboard.draw(messagedatatable);
    }​ 
    

    Example HTML:

    <div id="dash">
        <div id="control_div"></div>
        <div id="table_div"></div>
    </div>​​​​​​​​​​​​​
    

    If you want to be able to filter on more than one column, you need additional controls for each column you want to filter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a Google Search function, however I would like to leave the
I have some data that I am trying to display using the Google Visualization
I have created a google search box java script, I have applied it in
I have created an infobox using google maps api v3 and infoBox from the
I have created a datastore on the google app engine but would like to
I have created a simple web app/form using google app engine. the site is
I have a user that created about 50 sheets inside a Google Spreadsheet. Each
I have created my Portfolio and put there a Google+ button. The page is
I have been trying to create a new google custom search engine, but when
I have a Google Chart (using the Google Visualization API , not Google Charts

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.