界面最上边为三个 按钮 “添加”,“修改”,“停用”然后下面是一个列表,字段分别为“序号”,“用户名”,“角色”,“名称”,“账户状态”
(注:列表数据不用连接数据库,在程序里面写的)
点击 添加按钮,弹出对话框,对话框的界面为“用户名”,"角色"(同列表)填写的文本框,下面三个按钮"添加",“重置”,"关闭"
界面最下面是一个文本框 后面一个按钮“查询”,功能是按照名称查询列表另外,我自己在 EXT designer里面做了一个简单界面,copy到 .js文件中,页面引用这个js文件,页面中确无法显示,
代码如下:
Ext.MyGrid=Ext.extend(Ext.grid.GridPanel ,{
xtype:"grid",
title:"我的表格",
width:400,
renderTo:'uu',
height:253,
columns:[
{
header:"序号",
sortable:true,
resizable:true,
dataIndex:"id",
width:100
},
{
header:"用户名",
sortable:true,
resizable:true,
dataIndex:"customer",
width:100
},
{
header:"角色",
sortable:true,
resizable:true,
dataIndex:"role",
width:100
},
{
header:"名称",
sortable:true,
resizable:true,
dataIndex:"name",
width:100
},
{
header:"账户状态",
sortable:true,
resizable:true,
dataIndex:"status",
width:100
},
{
header:"备注",
sortable:true,
resizable:true,
dataIndex:"memo",
width:100
}
],
initComponent: function(){
this.tbar=[
{
id:"add",
text:"添加"
},
{
id:"renew",
text:"修改"
},
{
id:"delete",
text:"停用"
}
]
Ext.MyGrid.superclass.initComponent.call(this);
}
})
});望指教,谢谢
(注:列表数据不用连接数据库,在程序里面写的)
点击 添加按钮,弹出对话框,对话框的界面为“用户名”,"角色"(同列表)填写的文本框,下面三个按钮"添加",“重置”,"关闭"
界面最下面是一个文本框 后面一个按钮“查询”,功能是按照名称查询列表另外,我自己在 EXT designer里面做了一个简单界面,copy到 .js文件中,页面引用这个js文件,页面中确无法显示,
代码如下:
Ext.MyGrid=Ext.extend(Ext.grid.GridPanel ,{
xtype:"grid",
title:"我的表格",
width:400,
renderTo:'uu',
height:253,
columns:[
{
header:"序号",
sortable:true,
resizable:true,
dataIndex:"id",
width:100
},
{
header:"用户名",
sortable:true,
resizable:true,
dataIndex:"customer",
width:100
},
{
header:"角色",
sortable:true,
resizable:true,
dataIndex:"role",
width:100
},
{
header:"名称",
sortable:true,
resizable:true,
dataIndex:"name",
width:100
},
{
header:"账户状态",
sortable:true,
resizable:true,
dataIndex:"status",
width:100
},
{
header:"备注",
sortable:true,
resizable:true,
dataIndex:"memo",
width:100
}
],
initComponent: function(){
this.tbar=[
{
id:"add",
text:"添加"
},
{
id:"renew",
text:"修改"
},
{
id:"delete",
text:"停用"
}
]
Ext.MyGrid.superclass.initComponent.call(this);
}
})
});望指教,谢谢
解决方案 »
- 选项卡没效果谁帮我看看
- easyui datagrid 不能跨域访问吗
- div嵌套div,onmouseout事件怎样判断鼠标离开最外面的div
- 帮看下代码哪错了,总提示:NodeFilter对象未定义
- 我单击Clear按钮时,为什么不能清空name的value?或者怎么清空name的value?
- 跪求:用过sourceTec(一个用于生成导航条js的软件)的进!
- 求救!!请问点击页面能否触发事件,怎么触发?
- 函数问题
- js如何实现:判断浏览器语言设置,自动跳转到相应页面?
- net_lover(孟子E章):如何把弹出窗口的选项传到父窗口?
- 如何用jQuery 把div里面的文字去掉?
- js调用activex问题
2.最后添加一句:MyGrid.render();
<html>
<head>
<link rel="stylesheet" type="text/css" href="./css/ext-all.css" />
<script type="text/javascript" src="./js/ext/ext-base.js"></script>
<script type="text/javascript" src="./js/ext/ext-all.js"></script>
<script type="text/javascript" src="./mygrid.js"></script>
<script>
Ext.onReady(function(){
var grid = new Ext.MyGrid();
});
</script>
</head>
<body>
<div id="uu"></div>
</body>
</html>