Archive for 十二月 2009

 
 

使用BindingUtils绑定数据源的例子

//绑定数据
   var binding:BindingUtils=new BindingUtils();
   BindingUtils.bindProperty(view.helpTree,”dataProvider”,treeData,["node"]);
   view.helpTree.addEventListener(ListEvent.ITEM_CLICK,itemClick);
   view.showImage.addEventListener(ProgressEvent.PROGRESS,loadingProgressHandle);
   view.showImage.addEventListener(Event.COMPLETE,loadingCompleteHandle);

smarty模版

smarty模版截取字符串时,想让它自动先排除HTML标签

{$articlechoose[0].content | strip_tags}> 可以过滤掉所有html标签

{$articlechoose[0].content | truncate:100}截取字符

关于flex快捷键的说明

Ctrl-F11: 执行(Run)
F11: 除错(Debug)
Ctrl-Alt-Down: 重复目前所在编辑列(Repeat current line )
Alt-Up: 移动本列,或选择列往上移动(Move line (or selection) up )
Alt-Down: 移动本列,或选择列下往移动(Move line (or selection) down )
Ctrl-Click: 移至定义区(Go to definition (also F3) )
Ctrl-D: 删除本列(Delete line )
Alt-/: 文字自动完成(Word completion (cycles through possible matches))
Ctrl-Up: 捲轴向上(Scroll up )
Ctrl-Down: 捲轴向下(Scroll Down )
Shift+F2    弹出帮助窗体,显示选中标签的上下文帮助
F1          在IDE内显示上下文帮助
F3          显示当前选中标签的类定义
CTRL+0       在代码视窗显示大纲
CTRL+SHIFT+C  加注释

【xpage补充】
加几个常用的:
Ctrl+Shift+T:打开Class搜索框
Ctrl+Shift+R:打开资源搜索框
Ctrl+Shift+O:组织导入
Ctrl+M:最大化/恢复当前编辑框

【dzq补充】
Ctrl+Shift+L: 所有快捷键提示

【morningyi补充】
Ctrl+/:行注释

document.body.scrollTop失效!!

折腾了一天,撞鬼。想在商品列表中点击购买后弹出提示框,根据document.body.scrollTop设置显示位置,可偏偏失效。
原因:当网站做了以下声明时
<!--TYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.d-->

声明后document.body.scrollTop的值永远等于0,解决办法是只需把document.body用document.documentElement替换即可。

javascript关于top、clientTop、scrollTop、offsetTop等

附:javascript中关于top、clientTop、scrollTop、offsetTop等

网页可见区域宽: document.body.clientWidth;
网页可见区域高: document.body.clientHeight;
网页可见区域宽: document.body.offsetWidth (包括边线的宽);
网页可见区域高: document.body.offsetHeight (包括边线的宽);
网页正文全文宽: document.body.scrollWidth;
网页正文全文高: document.body.scrollHeight;
网页被卷去的高: document.body.scrollTop;
网页被卷去的左: document.body.scrollLeft;
网页正文部分上: window.screenTop;
网页正文部分左: window.screenLeft;
屏幕分辨率的高: window.screen.height;
屏幕分辨率的宽: window.screen.width;
屏幕可用工作区高度: window.screen.availHeight;
屏幕可用工作区宽度:window.screen.availWidth;