当前位置:编程学习 > JS >>

Extjs4---学习笔记,同步更新中。。。

1、action.result.message
用于显示后台的错误信息;
需要在后台定义message的变量
 var form = this.up('form').getForm();
            if (form.isValid()) {
                // Submit the Ajax request and handle the response
                form.submit({
                    success: function(form, action) {
                       Ext.Msg.alert('Success', action.result.message);
                    },
                    failure: function(form, action) {
                        Ext.Msg.alert('Failed', action.result ? action.result.message : 'No response');
                    }
                });
            }
2、Ext.MessageBox.show()显示空白
在做后台管理系统时遇到的问题,在有些页面用Ext.MessageBox.show()做提示框时会显示空白,然后用的
Ext.MessageBox.alert()代替的
3、分页显示:在前台配置pageSize:5后,但在后台还是接收到的默认值25,
应该pageSize:5放在
[javascript]
Ext.define('HT.store.Users',{ 
    //不要忘了继承 
    extend:'Ext.data.Store', 
    //记得设置model 
    model:'HT.model.User', 
    //自动加载设为true 
    autoLoad:true, 
    pageSize:10, 
    proxy: { 
        type: 'ajax', 
        url : 'user_get', 
        reader: { 
            //数据格式为json 
            type: 'json', 
            root: 'users', 
            totalProperty:'totalCount' 
        } 
    } 
}); 
而不是放在proxy里面,不过,再次之前放在proxy也可以,用了mvc后就不管用了
补充:web前端 , JavaScript ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,