jQuery MiniUI

标题: 求助求助 紧急求助 [打印本页]

作者: mfanworld    时间: 2013-12-4 18:19:00     标题: 求助求助 紧急求助

$.ajax({
                url : "......",
                type : "post",
                data : {
                    woNbr : nbr,
                    qty : qty,
                },
                success : function(text) {
                        var data = mini.decode(text);
                    grid.setData(data);
                },
                error : function(jqXHR, textStatus, errorThrown) {
                    alert(jqXHR.responseText);
                }
            });

text 有值,data也有 但是前台没有数据,也没有报错。


作者: lost    时间: 2013-12-4 20:04:50

1.grid.setData()需要的是一个数组,不是一个total和data的对象。url加载的时候才是需要一个这样的一个对象。
2.如果上述没有问题的话,检查field的有没有对应。
作者: mfanworld    时间: 2013-12-5 15:43:24

请看图片 action返回的是这样的 要怎么处理才能显示

作者: liunian    时间: 2013-12-5 16:06:38

mfanworld 发表于 2013-12-5 15:43
请看图片 action返回的是这样的 要怎么处理才能显示

貌似不用encode
作者: factory    时间: 2013-12-5 16:12:36

liunian 发表于 2013-12-5 16:06
貌似不用encode

setData()需要的是数组

你应该这个
var result= mini.encode(text);
var data = result.data;
var total = result.total;
grid.setData(data);
grid.setTotalCount(total);
作者: mfanworld    时间: 2013-12-5 16:17:48

factory 发表于 2013-12-5 16:12
setData()需要的是数组

你应该这个

不好用
success : function(text) {
                        var result= mini.encode(text);
                                        var data = result.data;
                                        var total = result.total;
                                        grid.setData(data);
                                        grid.setTotalCount(total);

                },
                error : function(jqXHR, textStatus, errorThrown) {
                    alert(jqXHR.responseText);
                }


作者: mfanworld    时间: 2013-12-5 16:19:01

liunian 发表于 2013-12-5 16:06
貌似不用encode

不用ecode也不好用
作者: factory    时间: 2013-12-5 16:29:54

mfanworld 发表于 2013-12-5 16:19
不用ecode也不好用

写错了
是decode(),不是encode()
var result = mini.decode(text)
作者: mfanworld    时间: 2013-12-5 16:30:30

mfanworld 发表于 2013-12-5 16:19
不用ecode也不好用

现在已经解决啦 var result= mini.decode(text); 谢谢各位~~~~




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