简体   繁体   中英

How to add multiple php grids in tabs container, one phpgrid per tab?

I tried to put jqgrids to my easyui tabs. When clicks one tab, one grid should load.

Below is my HTML code snippet for products.php:

<?php
//Start the Session
      if(!isset($_SESSION)) 
      { 
          session_start(); 
      } 

 // require_once("../includes/brand_name_gridview.php");
  include("../includes/brand_name_gridview.php");

?>

<div id="tabs" class="easyui-tabs">

<!--Here goes other code snippet-->

        <div title="Brand Name" id="tabs-1" style="display:none;"><br />
           <div><form id="manageBrandNameForm" name="manageBrandNameForm" method="post" action="../includes/brandname_functions.php#tabs-1">
              <table width="470" border="0" class="productsForm" align="center" frame="box" cellpadding="5px" bgcolor="#F2F2F2">
                 <tr>
                    <td width="200" align="left">Brand Name</td>
                    <td width="216"><span id="sprytextfield1">
                       <label>
                       <input name="txtBrandName" type="text" id="txtBrandName" tabindex="1" size="30"/>
                       </label>
                       <span class="textfieldRequiredMsg">A value is required.</span></span>
                    </td>
                 </tr>
                 <tr>
                    <td width="500" align="left">Brand Name Description</td>
                    <td><span id="sprytextarea1">
                       <label>
                       <textarea name="txtBrandNameDescription" id="txtBrandNameDescription" cols="32" rows="3" tabindex="3" class="txtArea"></textarea></label>
                       <span class="textareaRequiredMsg">A value is required.</span></span>
                    </td>
                 </tr>
                 <tr><td><img src="../images/brand_name.png"/></td>
                    <td colspan="2" align="right">
                       <input type="submit" name="btnSaveBrand" id="btnSaveBrand" value="SAVE" />
                       <input type="reset" name="btnReset" id="btnReset" value="RESET"/>
                    </td>
                 </tr>
              </table><br />

           </form></div>
              <div id="productDataGridDiv">
           <?php 
           echo $out; 
           ?>  
        <br />
     </div>
     <!--end dataGridDiv-->
        </div>
        <!--end tabs-1-->

In "brand_name_gridview.php", I created my grid and render like below:

   $out = $g->render("list1");

I can load one grid for one tab, but phpgrid.org not allows for multiple grid load per page in free version. Please help me to proceed with this to have a grid for a tab.

Are you referring to solution to jqgrid specifically or php grid? Here's an example you can try for tabbed datagrid. It works well for me.

http://phpgrid.com/example/tabbed-datagrid/

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM