jQuery MiniUI

标题: php 与 mini交互 探讨 并 求版主解决问题~!! [打印本页]

作者: ifour333    时间: 2012-4-11 15:07:45     标题: php 与 mini交互 探讨 并 求版主解决问题~!!

{"total":10,"data":[{"log_id":"1","member_id":"194","money":"1000.000","message":"admin\u7ba1\u7406\u5458\u4ee3\u5145\u503c","mtime":"1324116887","payment_id":""},{"log_id":"2","member_id":"365","money":"600.000","message":"zhanxiaohu\u7ba1\u7406\u5458\u4ee3\u5145\u503c","mtime":"1324118456","payment_id":""},{"log_id":"3","member_id":"348","money":"200.000","message":"zhanxiaohu\u7ba1\u7406\u5458\u4ee3\u5145\u503c","mtime":"1324118539","payment_id":""}

以上是我pHP 返回的数据json的

<div title="数据层" region="center" >
       <div id="datagrid1" class="mini-datagrid" style="width:700px;height:280px;" url="../index.php/Index/testdata">
  <div property="columns">
  <!-- <div type="indexcolumn" ></div> -->
   <div field="log_id" width="120" headerAlign="center" allowSort="true">员工帐号</div>   
   <div field="member_id" width="120" headerAlign="center" allowSort="true">姓名</div>                           
   <div field="money" width="100" renderer="onGenderRenderer" align="center" headerAlign="center">性别</div>
   <div field="message" width="100" allowSort="true">薪资</div>                                    
   <div field="mtime" width="100" allowSort="true">年龄</div>
   <div field="payment_id" width="100" headerAlign="center" allowSort="true">创建日期</div>               
  </div>
    </div>  

数据不显示  是为啥   

public function testdata(){
        $model = new Model();
        $sql = "SELECT log_id,member_id,money,message,mtime,payment_id FROM member_ad limit 0,10";
        $user = $model->query($sql);
        $result[total] = 10;
        $result[data] = $user;
        
       //echo json_encode($results);
        //die();
        return json_encode($result);
    }

作者: xiwa    时间: 2012-4-11 16:42:57

返回数据贴全了?贴全了的话,最后少了]}
一般应该不会有问题
作者: ifour333    时间: 2012-4-11 17:17:50

{"total":10,"data":[{"log_id":"1","member_id":"194","money":"1000.000","message":"admin\u7ba1\u7406\u5458\u4ee3\u5145\u503c","mtime":"1324116887","payment_id":""},{"log_id":"2","member_id":"365","money":"600.000","message":"zhanxiaohu\u7ba1\u7406\u5458\u4ee3\u5145\u503c","mtime":"1324118456","payment_id":""},{"log_id":"3","member_id":"348","money":"200.000","message":"zhanxiaohu\u7ba1\u7406\u5458\u4ee3\u5145\u503c","mtime":"1324118539","payment_id":""},{"log_id":"4","member_id":"366","money":"200.000","message":"zhanxiaohu\u7ba1\u7406\u5458\u4ee3\u5145\u503c","mtime":"1324118601","payment_id":""},{"log_id":"5","member_id":"194","money":"41.800","message":"\u9884\u5b58\u6b3e\u652f\u4ed8\u8ba2\u5355","mtime":"1324135018","payment_id":"13241350181493"},{"log_id":"6","member_id":"194","money":"18.800","message":"\u9884\u5b58\u6b3e\u652f\u4ed8\u8ba2\u5355","mtime":"1324137997","payment_id":"13241379972660"},{"log_id":"7","member_id":"194","money":"10.600","message":"\u9884\u5b58\u6b3e\u652f\u4ed8\u8ba2\u5355","mtime":"1324140957","payment_id":"13241409566680"},{"log_id":"8","member_id":"194","money":"10.600","message":"\u9884\u5b58\u6b3e\u652f\u4ed8\u8ba2\u5355","mtime":"1324140974","payment_id":"13241409743635"},{"log_id":"9","member_id":"194","money":"10.600","message":"\u9884\u5b58\u6b3e\u652f\u4ed8\u8ba2\u5355","mtime":"1324140989","payment_id":"13241409888479"},{"log_id":"10","member_id":"194","money":"10.600","message":"\u9884\u5b58\u6b3e\u652f\u4ed8\u8ba2\u5355","mtime":"1324140999","payment_id":"13241409986626"}]}
作者: ifour333    时间: 2012-4-11 17:18:12

应该不是数据问题吧
作者: ifour333    时间: 2012-4-11 17:40:46

可能这个ui 还不能和PHP 兼容吧
作者: fcrong    时间: 2012-4-11 18:21:14

请把数据JSON作为一个文档上传。
我们下载后,会在本地测试。
这样问题就可以快速定位了。




欢迎光临 jQuery MiniUI (http://miniui.com/discuss/) Powered by Discuz! X2