解决方案 »

  1.   

    这个基本上Ajax的方式了。写个接口给JS调用查询数据就成了。
      

  2.   

    可以写段代码让我看看吗?我是写的datagrid的一个  onClickrow事件,但是没反应。
      

  3.   

    http://www.w3cschool.cc/jeasyui/jeasyui-datagrid-datagrid22.html
    这个示例不能满足你的要求吗?
      

  4.   

    var url;
    $(document).ready(function() {
    $('#dg').datagrid({
    onClickRow:function () {
    var row = $('#dg').datagrid("getSelected");
    url = '../php/trade.php?o=list_pro&pid='+row.pid;
     $('#dg_project').datagrid('reload');
    // alert('pid='+row.pid);
    }
    });
    });
    <table id="dg_project" class="easyui-datagrid"  url="../php/trade.php?o=list_pro>
    <!--
        <th></th>
    -->
    </table
    这么写单击可以获取到pid,也可以让#dg_project这个datagrid进行加载,但是不显示数据,可以帮忙修改下吗?
      

  5.   

    要的效果跟他有些差距。  我是在dg1上获取id 传到php,然后php通过这个id查询数据后把数据再返回到dg2上。
    现在遇到了一些问题。 dg2的url是这么写的 url="../php/trade.php"
    dg1的onclickrow传的url="../php/trade.php?pid="+row.pid
    我觉得可能是dg2的url的问题。但是dg2的url后面又不能加上+row.pid
      

  6.   


        <table id="dg" title="投资记录" class="easyui-datagrid" style="height: 500px; width: 100%;" 
            url="../php/trade.php?o=list" pagesize="50" toolbar="#toolbar" pagination="true" fitColumns="true" rownumbers="true"  singleSelect="true">
        <thead>
    <tr>
    <th field="pid" align="center" width="70">产品单号</th>
    <th field="project_amount" align="center" width="50">金额</th>
    <th field="value_date" align="center" width="50">起息日</th>
    <th field="due_date" align="center" width="50">到期日</th>
    <th field="term" align="center" width="40" formatter="formatTerm">期限</th>
    <th field="term_type" align="center" width="40" formatter="formatTtype">期限类型</th>
    <th field="invest_rate" align="center" width="50">投资利率</th>
    <th field="invest_once" align="center" width="50">单笔投资</th>
    <th field="use_reward" align="center" width="50" formatter="formatRtype">可用红包类型</th>
    <th field="invest_allow_back" align="center" width="50" formatter="formatSH">赎回</th>
    <th field="publish_invest" align="center" width="50" formatter="formatAllowBack">发布理财</th>
    <th field="description" align="center" width="50">简单描述</th>
    <th field="invest_amount" align="center" width="50">已投金额</th>
    <th field="invest_count" align="center" width="50">已投次数</th>
    </tr>
        </thead>
    </table>
        <div data-options="region:'center'" style="width: 50%;">
            <table id="dg_project" title="项目投资者" class="easyui-datagrid" data-options="fit:true" toolbar="searchtool" style="height: 348px;" pagination="true" fitColumns="true" rownumbers="true"  singleSelect="true">
                <thead>
                    <tr>
                     <th field="phone" width="50">手机号</th>
                     <th field="name" width="50">姓名</th>
                        <th field="trade_amount" width="50">投资金额</th>             
                    </tr>
                </thead>
            </table>
        </div>
            var url;
    $(document).ready(function() {
    $('#dg').datagrid({
    onClickRow:function () {
    var row = $('#dg').datagrid("getSelected");
    url = '../php/trade.php?o=list_pro&pid='+row.pid;
    }
    });
    });
      

  7.   


    <?php
    if($o == 'list_pro')
    {
        $pid = $_GET['pid'];
        $page = isset($_POST['page']) ? intval($_POST['page']) : 1; 
         $rows = isset($_POST['rows']) ? intval($_POST['rows']) : 10;
    $page = isset($_GET['page']) ? intval($_GET['page']) : $page; 
    $rows = isset($_GET['rows']) ? intval($_GET['rows']) : $rows;
    $index = ($page - 1) * $rows;
    $total = "select count(tid) from e_trade";
    $sql = "SELECT a.trade_amount, c.phone, c.name from e_trade a join e_project b on a.pid = b.pid join e_user c on c.uid = a.uid where b.pid = '$pid' limit $index, $rows";
    echo get_js_page($total, $sql);
    }
    ?>