Extjs4 的一些语法 持续更新中
一、给GridPanel增加成两行toolbar
tbar: {
xtype: 'container',
layout: 'anchor',
defaults: {anchor: '0'},
defaultType: 'toolbar',
items: [{
items: [...] // toolbar 1
}, {
items: [...] // toolbar 2
}]
}
二、去掉formPanel的边框
var postForm = Ext.create('Ext.form.Panel', {
style:'border-width:0 0 0 0;',
三、Grid SelectModel
var grid = Ext.create('Ext.grid.Panel', {
id: 'user_grid',
selModel: Ext.create('Ext.selection.CheckboxModel',{mode: "MULTI"}),
var records = grid.getSelectionModel().getSelection();
四、store
var store = Ext.create('Ext.data.JsonStore', {
pageSize : Math.floor(clientHeight/25),
proxy : {
type : 'ajax',
url : '/system_cases.do?method=getList',
reader : {
type : 'json',
root : 'datas',
totalProperty : 'sum',
idProperty: "case_id"
}
},
fields: ['case_id', 'case_name', 'case_des', 'enabled', 'create_user_name', 'create_dt']
});
五、store reload传入搜索条件,适用于带条件翻页
//extjs4
store.on('beforeload',function(store, options){
Ext.apply(store.proxy.extraParams, {
'log_info': Ext.getCmp('log_info').getValue(),
'start_date': Ext.getCmp("start_date").getValue(),
'end_date': Ext.getCmp("end_date").getValue()
});
}); //extjs3
store.on('beforeload',function(){
Ext.apply(
this.baseParams,
{
'fileDto.file.title':Ext.getCmp('title').getValue(),
'fileDto.file.fileCodeNum':Ext.getCmp('fileCodeNum').getValue(),
'fileDto.file.year':Ext.getCmp('year').getValue()
}
);
});
六、checkbox以及radio
var role_store = Ext.data.StoreManager.lookup('role_store');
var user_role_store = Ext.create('Ext.data.JsonStore', {
fields: ['users_id', 'role_id', 'users2role_id'],
proxy: {
type: 'ajax',
//the store will get the content from the .json file
url: '/system_user.do?method=getUserRoleList&users_id='+record.data.users_id,
reader : {
type : 'json',
root : 'datas',
totalProperty : 'sum',
idProperty: "users2role_id"
}
}
});
var role_data = new Array();
role_store.each(function(record) {
role_data.push({
boxLabel: record.data.role_name,
name: 'role_ids',
inputValue: record.data.role_id
});
});
var checkGroup = {
xtype: 'fieldset',
title: '角色管理',
layout: 'anchor',
defaults: {
anchor: '100%'
},
collapsible: true,
collapsed: false,
items: [{
xtype: 'checkboxgroup',
fieldLabel: '用户角色',
name: 'user_role_group',
//cls: 'x-check-group-alt',
// Distribute controls across 3 even columns, filling each row
// from left to right before starting the next row
columns: 2,
items: role_data
}]
};
//将radio选择默认值
postForm.getForm().findField("user_role_group").setValue({role_ids: user_role_array});
七、Grid提示
{text: "略缩图", dataIndex: 'img',
renderer: function(value, metaData, record, rowIndex, columnIndex, store) {
var meta = "<img src='system/desktop/images/grid32x32.gif' />";
metaData.tdAttr = 'data-qtip="' + meta +'"';
return '<img width="20" height="20" src="system/images/loading.gif" class="pic" errorimg="system/desktop/images/accordian.gif">';
}
}
//extjs3 的实现方式
{header: "内容", width: 320, sortable: true, dataIndex: 'noteContent',
renderer: function(value, metadata, record, rowIndex, columnIndex, store) {
metadata.attr = 'ext:qtip="内容详细信息:<br/>' + value +'"';
return value;
}
}
八、远程排序
Extjs4 的一些语法 持续更新中的更多相关文章
- Pig基础学习【持续更新中】
*本文参考了Pig官方文档以及已有的一些博客,并加上了自己的一些知识性的理解.目前正在持续更新中.* Pig作为一种处理大规模数据的高级查询语言,底层是转换成MapReduce实现的,可以作为MapR ...
- Pig语言基础-【持续更新中】
***本文参考了Pig官方文档以及已有的一些博客,并加上了自己的一些知识性的理解.目前正在持续更新中.*** Pig作为一种处理大规模数据的高级查询语言,底层是转换成MapReduce实现的, ...
- 白话kubernetes的十万个为什么(持续更新中...) - kubernetes
Kubernetes简称? 答:k8s或kube. Kubernetes是什么? 答:由Google开发的一个强大的平台,可以在集群环境中管理容器化应用程序.本质上是一种特殊的数据库,里面存储的是能够 ...
- git常用命令(持续更新中)
git常用命令(持续更新中) 本地仓库操作git int 初始化本地仓库git add . ...
- Atom使用记录(持续更新中)
部分内容取自:http://www.jianshu.com/p/dd97cbb3c22d,我自己也在使用,持续更新中 Atom安装插件在窗口中File---Setting---install 在里面进 ...
- java视频教程 Java自学视频整理(持续更新中...)
视频教程,马士兵java视频教程,java视频 1.Java基础视频 <张孝祥JAVA视频教程>完整版[RMVB](东西网) 历经5年锤炼(史上最适合初学者入门的Java基础视频)(传智播 ...
- 系列文章:老项目的#iPhone6与iPhone6Plus适配#(持续更新中,更新日期2014年10月12日 星期日 )
本文永久地址为http://www.cnblogs.com/ChenYilong/p/4020399.html ,转载请注明出处. ********************************** ...
- 知道创宇爬虫题--代码持续更新中 - littlethunder的专栏 - 博客频道 - CSDN.NET
知道创宇爬虫题--代码持续更新中 - littlethunder的专栏 - 博客频道 - CSDN.NET undefined 公司介绍 - 数人科技 undefined
- Python开发【第二十三篇】:持续更新中...
Python开发[第二十三篇]:持续更新中...
随机推荐
- LUOGU P2290 [HNOI2004]树的计数(组合数,prufer序)
传送门 解题思路 \(prufer\)序,就是所有的不同的无根树,都可以转化为唯一的序列.做法就是每次从度数为\(1\)的点中选出一个字典序最小的,把这个点删掉,并把这个点相连的节点加入序列,直到只剩 ...
- Markdown转义字符表
- day22_5-xml模块
# 参考资料:# python模块(转自Yuan先生) - 狂奔__蜗牛 - 博客园# https://www.cnblogs.com/guojintao/articles/9070485.html ...
- PAT甲级——A1127 ZigZagging on a Tree【30】
Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can ...
- npm安装vuex及防止页面刷新数据丢失
npm install vuex 在项目scr目录下新建store文件夹,在store文件夹下新建index.js文件. import Vue from 'vue'; import Vuex from ...
- js 实现纵向轮播
效果 html <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <t ...
- Activiti添加批注(comment)信息
在每次提交任务的时候需要描述一些批注信息,例如:请假流程提交的时候要描述信息为什么请假,如果领导驳回可以批注驳回原因等 1.添加批注 // 由于流程用户上下文对象是线程独立的,所以要在需要的位置设置, ...
- SDOI2018Round1 && 九省联考 爆炸记
Day 0 做了一上午火车,大概中午十二点左右到了烟台核电培训中心宾馆,宾馆蛮不错的,跟我在北京参加英才论坛时住的宾馆舒适程度上差不多. 下午花式颓颓颓,吃了晚饭(体验一般)去试机,听说用Lemon评 ...
- Qt连接sql server数据库遇到的问题
在QT中使用addDataBase添加一个数据库连接,其中第一个参数应该填入使用数据库驱动的类型,如QMYSQL.QSQLLITE.QSQLPSSQL等. QSqlDatabase QSqlD ...
- C++ 系列:typedef 和 #define 的区别
总结一下typedef和#define的区别 1.概念 #define 它在编译预处理时进行简单的替换,不作正确性检查.它是预处理指令. typedef 它在自己的作用域内给一个已经存在的类型一个别名 ...