ExtJs之Ext.core.Element
<!DOCTYPE html>
<html>
<head>
<title>ExtJs</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" type="text/css" href="ExtJs/packages/ext-theme-crisp/build/resources/ext-theme-crisp-all.css">
<script type="text/javascript" src="ExtJs/ext-all.js"></script>
<script type="text/javascript" src="ExtJs/bootstrap.js"></script>
<script type="text/javascript" src="ExtJs/packages/ext-theme-crisp/build/ext-theme-crisp.js"></script>
<script type="text/javascript">
Ext.onReady(function(){
var el = Ext.get("the-id");
var appendEl = Ext.get("the-id-append");
function fn1(){
Ext.Msg.alert("notice", "You press ctrl + c at the Element named the_id");
}
el.addCls("special-css");
appendEl.addCls("special-css");
appendEl.setWidth(240);
appendEl.setWidth(240, true);
el.focus();
el.addClsOnFocus("focus-css");
el.addClsOnOver("mouseover-css");
el.addClsOnClick("click-css");
el.setWidth(240);
el.setWidth(240, true);
el.addKeyMap({key: "c", ctrl: true, fn: fn1, scope: el});
el.addKeyListener({key: "g", ctrl: true}, fn1, el);
});
function callAppend(){
Ext.Msg.alert("notice", Ext.get("the-id-append"));
Ext.get("the-id").appendTo(Ext.get("the-id-append"));
}
</script>
</head>
<body>
<table border="0" cellspacing="3" cellpadding="3"><tr><td></td></tr></table>
<table border="0" cellspacing="1" cellpading="3" align="center" width="240" height="180" bgcolor="#3399cc">
<tr>
<td bgcolor="F3FAF9">测试样例</td>
</tr>
<tr>
<td bgcolor="#FBFFFF">
<div id="the-id">通过取得ELEMNET ID 为THE_ID的DIV并为该DEV绑定一些事事,如: 为鼠标移过此DIV时改变样式表等</div>
</td>
</tr>
</table>
<table border="0" cellspacing="0" cellpading="0" align="center" width="240" height="40" >
<tr><td align="left">
<input type="button" value="点击查看追加效果" id="bt1" onclick="callAppend()">
</td></tr>
</table>
<table border="0" cellspacing="1" cellpading="3" align="center" width="240" height="180" bgcolor="#3399CC">
<tr>
<td bgcolor="#F3FAF9">追加元素</td>
</tr>
<tr>
<td bgcolor="#FBFFFF">
<div id="the-id-append"> 被追加的元素</div>
</td>
</tr>
</table>
</body>
</html>


ExtJs之Ext.core.Element的更多相关文章
- ExtJs之Ext.core.DomQuery
<!DOCTYPE html> <html> <head> <title>ExtJs</title> <meta http-equiv ...
- ExtJs之Ext.core.DomHelper.append
<!DOCTYPE html> <html> <head> <title>ExtJs</title> <meta http-equiv ...
- ExtJS初接触 —— 了解 Ext Core
ExtJS初接触 —— 了解 Ext Core Ext Core是一款和jQuery媲美的轻型JS库,基于MIT许可.对于Dom的操作,我个人还是比较喜欢用jQuery.当然如果项目中用的是ExtJS ...
- ExtJS初探:了解 Ext Core
Ext Core是一款和jQuery媲美的轻型JS库,基于MIT许可.对于Dom的操作,我个人还是比较喜欢用jQuery.当然如果项目中用的是ExtJS框架,也就没必要多引用一个jQuery,Ext ...
- ExtJS学习之路第二步:Ext.Component 和 Ext.dom.Element 的区别
让我们来初步的探讨下Ext.Component和Ext.Element的区别. jQuery偏重于DOM元素的操作 1.每一个HTML页面都有一个层次分明的DOM树模型,浏览器中的所有内容都有相应的D ...
- ExtJS学习--------Ext.Element中的经常使用事件和其它重要的方法学习(实例)
经常使用事件: 其它重要方法: 详细实例:(实例结果能够将相应的代码取消凝视进行測试) Ext.onReady(function(){ Ext.create('Ext.panel.Panel',{ t ...
- ExtJS得知--------Ext.Element学习的查询方法(示例)
详细实例:(实验结果可复制代码后进行演示) Ext.onReady(function(){ Ext.create('Ext.panel.Panel',{//创建一个面板 title:'我的面板' , ...
- ExtJS学习-------Ext正确Dom操作:Ext.get Ext.fly Ext.getDom
详细实例: (1)创建JSP文件.引入CSS和js文件,加入三个Div <%@ page language="java" import="java.util.*&q ...
- Ext.dom.Element 常用方法解析
Ext.dom.Element 常用方法解析 Ext.Element,Ext.core.Elemen,Ext.dom.Element 这几个类都是一个类,在EXT当中给起了别名而已,这个类到作用主要是 ...
随机推荐
- libevent I/O示例
I/O示例使用一个windows平台上服务器/客户端的例子来演示.由于为了减少代码篇幅等各种由于本人懒而产生的原因,以下代码没有做错误处理以及有些小问题,但是我想应该不影响演示,大家多包涵. 服务器代 ...
- iOS学习之C语言函数指针
通过函数名调用函数: int max = maxValue(4, 5); printf("max = %d\n", max); 函数类型:int (int, int) 1. ...
- iOS另类的内存管理
iOS的内存管理算是老生常谈的问题了,我们写iOS的时候无时无刻不在涉及到内存管理.从开始的MRR(manual retain-release)到后来ARC(Automatic Reference C ...
- 在ASP.NET中实现OAuth2.0(二)之打造自己的API安全策略
1.场景介绍 公司开发了一款APP产品,前期提供的api接口都是裸奔状态 举个例子:想要获取某一个用户的数据,只需要传递该用户的ID就可以拿走数据(说多了都是泪) 现在想给这些接口穿个衣服,加个壳(对 ...
- Entity Framework 泛型使用
因为增删改查是我们常用到的方法,我们不可能每个数据模型都去完成增删改查,这样的办法太笨拙了.我们可以写个父类(包含增删改查),然后让所有的数据模型类继承该父类.那就要求我们的父类必须使用泛型来实现. ...
- 团队项目--“我爱淘”校园二手书店 NABC分析
本项目的特点之一:可查询功能 NABC分析: N(Need):方便校园里的学生查找自己需要的二手书籍,免了同学想买二手书还得跑到阿姨那里去看. A(Approach):将学生的信息和书籍的信息都存放在 ...
- Careercup - Google面试题 - 5162732873580544
2014-05-08 08:26 题目链接 原题: Given a preorder traversal, create a binary search tree in optimized time ...
- 【Path Sum】cpp
题目: Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up ...
- javascript进行url转义方法比较escape、encodeURI和encodeURIComponent
escape会将除了 ASCII 字母.数字和特定的符号(* @ - _ + . /)以外的字符全部进行转义编码,因此如果想对URL编码,最好不要使用此方法,因为它会让你的URL变的不可读. 提示:E ...
- httpclient模拟浏览器get\post
一般的情况下我们都是使用IE或者Navigator浏览器来访问一个WEB服务器,用来浏览页面查看信息或者提交一些数据等等.所访问的这些页面有的仅 仅是一些普通的页面,有的需要用户登录后方可使用,或者需 ...