Javascript - ExtJs - Toolbar - 工具栏
Toolbar组件
创建工具栏
Toolbar类是一种子组件,它不能独立存在,需要依附在其它组件上面。很多容器组件都具备tbar(顶部工具栏)、bbar(底部工具栏)的配置,所以可以像下面那样使用它。
tbar: {
id: "tool",
width: ,
height: ,
items: [
{ text: "新 增", itemId: "btn1", style: "background:none;border:none;",iconCls: "btnIco", handler: function () { alert() } }, //默认是按钮
{ xtype: 'tbseparator' }, //分隔符
{ xtype: 'tbspacer', width: }, //指示物件的间距
{ xtype: "text", text: "纯文本" },
{ xtype: 'tbfill' }, //指示出现在tbfill之后的物件右对齐
{ xtype: "textfield",fieldLabel:"查询",labelWidth: }, //可配置为表单组件
]
}
设置按钮内的文字和按钮内的图标
/*按钮文字*/
.x-btn-inner {
font-family: Arial !important;
color: white !important;
} /*按钮a标签*/
.x-btn {
text-decoration: none !important;
} /*按钮内图标*/
.btnIco {
background: url(../../Img/Ico/login.png);
margin-left:78px;
}
创建菜单
菜单组件可浮动在鼠标的轨迹上,也可以附加在工具栏上。
Ext.create("Ext.grid.Panel", {
//……
listeners: {
itemcontextmenu: function (view, record, item, index, e) {
e.preventDefault();
Ext.create("Ext.menu.Menu", {
id: "contextmenu",
items: [
{
text: "全选",
handler: function () {
}
},
{
text: "反选",
hanlder: function () {
}
}
],
listeners: {
deactivate: function (menuSelf) {
menuSelf.destroy(); //消失后销毁自身
}
}
});
Ext.getCmp("contextmenu").showAt(e.getXY()); //显示在鼠标右键点击处
}
}
});
浮动
id: "tool",
width: ,
height: ,
items: [
{
type: "button",
text: "文 件",
itemId: "btn1",
style: "background:none;border:none;text-decoration:none;",
menu: {
items: [
{ text: '复制', hanler: function () {/*点击菜单时触发*/ },deactivate:function()(menuSelf){/*菜单消失后触发*/} },
{ text: '剪切' },
{ text: '撤销' }
]
}
}
]
}
固定
创建按钮
Ext.create('Ext.Button', {
text: 'OK',
style: "background:red;border:none;margin:10px 0;", icon: "../img/ico/expand-down.png",
renderTo: "bbtn",
handler: function () { }
});

{
xtype: "button",
text: "选择全部",
style: "margin-right:10px;",
handler: function () {
//获得按钮的文字
if (this.getText() == "选择全部") {
//设置按钮的文字
this.setText("全部取消");
}
else {
this.setText("选择全部");
}
}
}
Javascript - ExtJs - Toolbar - 工具栏的更多相关文章
- Javascript - ExtJs - GridPanel组件
GridPanel组件(Ext.grid.GridPanel)logogram:Ext.grid.Panel | xtype:gridpanel 此类派生自Ext.Panel,创建表格需要两个必须的对 ...
- [转载]ExtJs4 笔记(12) Ext.toolbar.Toolbar 工具栏、Ext.toolbar.Paging 分页栏、Ext.ux.statusbar.StatusBar 状态栏
作者:李盼(Lipan)出处:[Lipan] (http://www.cnblogs.com/lipan/)版权声明:本文的版权归作者与博客园共有.转载时须注明本文的详细链接,否则作者将保留追究其法律 ...
- Javascript - ExtJs - Ext.form.Panel组件
FormPanel组件(Ext.form.FormPanel) logogram:Ext.form.Panel | xtype:form Ext.form.Panel.配置 frame }//旗下所有 ...
- ExtJs4 笔记(12) Ext.toolbar.Toolbar 工具栏、Ext.toolbar.Paging 分页栏、Ext.ux.statusbar.StatusBar 状态栏
本篇讲解三个工具栏控件.其中Ext.toolbar.Toolbar可以用来放置一些工具类操控按钮和菜单,Ext.toolbar.Paging专门用来控制数据集的分页展示,Ext.ux.statusba ...
- 第15.15节 PyQt(Python+Qt)入门学习:Designer的menu菜单、toolBar工具栏和Action动作详解
老猿Python博文目录 老猿Python博客地址 一.引言 Qt Designer中的部件栏并没有菜单.toolBar以及Action相关的部件,仅在MainWindow类型窗口提供了menu.to ...
- ExtJs之工具栏及菜单栏
先培养一下大概的感觉吧. 基本按书上都弄出来了. <!DOCTYPE html> <html> <head> <title>ExtJs</titl ...
- Javascript - ExtJs - 整合百度文章编辑器
ExtJs - 整合百度文章编辑器(ExtJs UEditor) 第一步:去官网下载最新版本的UEditor,UEditor下载. 第二步:在编辑器根目录创建一个Extjs-Editor.js,录入以 ...
- Javascript - ExtJs - 组件 - 分页
服务端只需要返回如下格式的字符串,ExtJs就可以解析并自动生成分页数据. , name: "sam" } ] } 准备: CREATE PROCEDURE [dbo]. ...
- Javascript - ExtJs - Itemselector
引入扩展文件 Extjs4.2根目录下: examples \ ux \ css \ images (这是选择按钮的图片资源) examples \ ux \ css \ ItemSelector.c ...
随机推荐
- JDBC 增、改、删 MySQL中的表
在数据库test里先创建表school,内容如下 通过JDBC增加第五人tom,修改他的生日,最后删除tom import java.sql.Connection; import java.sql.D ...
- (栈)leetcode856 Score of Parentheses
Given a balanced parentheses string S, compute the score of the string based on the following rule: ...
- go框架gin的使用
我们在用http的时候一般都会用一些web框架来进行开发,gin就是这样的一个框架,它有哪些特点呢 一:gin特点 1.性能优秀2.基于官方的net/http的有限封装3.方便 灵活的中间件4.数据绑 ...
- 关键字(3):order by/group by/having/where/sum/count(*)...查询结果筛选关键字
ORDER BY <属性表> 只要在WHERE子句的选择条件后面加上如下子句:ORDER BY <属性表> 就可以实现输出的排序,默认的顺序为升序(ASC).可以在属性的后面加 ...
- java io系列25之 PrintWriter (字符打印输出流)
更多内容请参考:java io系列01之 "目录" PrintWriter 介绍 PrintWriter 是字符类型的打印输出流,它继承于Writer.PrintStream 用于 ...
- synchronized 和lock的区别
synchronized 是什么时候释放? 1.获取锁的线程执行完代码2.线程执行出现异常 synchronized 的缺陷? 1.Lock类可以主动释放锁.2.synchronized 是被动. R ...
- EL表达式遍历集合获取下标
如题,HTML页面很多时候需要循环遍历一个集合,并且获得集合元素得下标做判断,或者把下标传递给后台作为参数 那么我们就需要用到EL表达式的varStatus 代码一:<c:forEach var ...
- Elasticsearch 集群 单服务器 超级详细教程
前言 之前了解了Elasticsearch的基本概念.将spring boot + ElasticSearch + head插件 搞通之后.紧接着对es进行下一步的探索:集群.查阅资料的过程中,找到了 ...
- invalid location of tag 解决办法
转自:https://blog.csdn.net/tanzuai/article/details/41896579 在jsp页面使用标签过程中有时候不注意规则的话,eclipse会提示一些错误,下面针 ...
- 前端下拉框选择和动态生成调用div
进入到一个项目期中,一边做项目,一边学习其中用到的知识.这些知识都是零碎的,有数据库,有html,有js,还有django.趁周末时间,整理前面遇到过的前端相关的知识点. 下拉框选择 <html ...