CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Control 2 grids with 1 Search

Print topic Send  topic

Author Message
goatmilk

Posts: 10
Posted: 02/17/2010, 2:46 AM

Hi All

I have a page with 2 tabs on it. Each tab has a grid that displays information from the same table, just different columns. Is it possible to have a single search box to control the 2 grids on each tab?

Example, I have a table that contains product measurements. Each product has measurements for of 50g and 100g of the product. On tab 1 I want to display the measurements for 50g and tab 2 the measurements for 100g. I want the user to be able to select the category and product from a single search box and then have both grids on each tab update. The user can then click on the tab they want to see the measurements for.

Help would be much appreciated.
View profile  Send private message
andy


Posts: 183
Posted: 02/18/2010, 4:31 AM

You should be able to do that.
Here are a couple of hints:
If you are using the tabview method, then place all the divs INSIDE the form

  
<!-- BEGIN Record ... -->  
<form method="post" name="{HTMLFormName}" action="{Action}">  
  
<!-- BEGIN tab header definitions ... -->  
  <div id="demo" class="yui-navset">  
    <ul class="yui-nav">  
      <li class="selected"><a href="#tab1"><em>50g</em></a> </li>  
      <li class="selected"><a href="#tab2"><em>100g</em></a> </li>  
    </ul>  
    <div class="yui-content">  
<!-- END tab header definitions ... -->  
  
      <div id="tab1">  
Contents of tab 1  
      </div>  
      <div id="tab2">  
Contents of tab 2  
      </div>  
    </div>  
  </form>  
</div>  
<!-- END Record ... -->  
<div id="demo" class="yui-navset">  
  <script>  
(function() {  
    var tabView = new YAHOO.widget.TabView('demo');  
  
    YAHOO.log("The example has finished loading; as you interact with it,   
you'll see log messages appearing here.", "info", "example");  
})();  
</script>  
</div>  
 

The above doesn't include the Search fields. You can put those on a third tab if you want.

The next question is how to control switching to specific tabs. You may need to set and get some session variables.
Here's a couple of posts on how to get this to work:
http://blog.davglass.com/files/yui/tab7/index.php#tab3
http://developer.yahoo.com/yui/tabview/#handlingevents

Good luck!

_________________
Andy

RAD tools for rich UI controls:
http://www.koolphptools.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.