﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-liubijin-随笔分类-ExtJS</title><link>http://www.blogjava.net/liubijin/category/44663.html</link><description /><language>zh-cn</language><lastBuildDate>Wed, 05 May 2010 08:33:15 GMT</lastBuildDate><pubDate>Wed, 05 May 2010 08:33:15 GMT</pubDate><ttl>60</ttl><item><title>js报错：Object doesn't support this property or method</title><link>http://www.blogjava.net/liubijin/archive/2010/05/04/320040.html</link><dc:creator>無所謂</dc:creator><author>無所謂</author><pubDate>Tue, 04 May 2010 06:09:00 GMT</pubDate><guid>http://www.blogjava.net/liubijin/archive/2010/05/04/320040.html</guid><wfw:comment>http://www.blogjava.net/liubijin/comments/320040.html</wfw:comment><comments>http://www.blogjava.net/liubijin/archive/2010/05/04/320040.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/liubijin/comments/commentRss/320040.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/liubijin/services/trackbacks/320040.html</trackback:ping><description><![CDATA[&nbsp;js报错：<br />
&nbsp; Object doesn't support this property or method<br />
&nbsp;问题原因：<br />
&nbsp;1：js代码用了javas<wbr>cript关键字<br />
&nbsp;2：方法名和表单或者div form名冲突<br />
&nbsp;3.button中有name＝"submit"<br />
&nbsp;4.上传图片时提示：Object doesn't support this property or method <br />
原因：服务器上安装的AspJpeg的版本低于1.4版。<br />
解决方法：安装1.4或以上版本的AspJpeg组件。
<img src ="http://www.blogjava.net/liubijin/aggbug/320040.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/liubijin/" target="_blank">無所謂</a> 2010-05-04 14:09 <a href="http://www.blogjava.net/liubijin/archive/2010/05/04/320040.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>extbuilder </title><link>http://www.blogjava.net/liubijin/archive/2010/05/04/320009.html</link><dc:creator>無所謂</dc:creator><author>無所謂</author><pubDate>Tue, 04 May 2010 03:20:00 GMT</pubDate><guid>http://www.blogjava.net/liubijin/archive/2010/05/04/320009.html</guid><wfw:comment>http://www.blogjava.net/liubijin/comments/320009.html</wfw:comment><comments>http://www.blogjava.net/liubijin/archive/2010/05/04/320009.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/liubijin/comments/commentRss/320009.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/liubijin/services/trackbacks/320009.html</trackback:ping><description><![CDATA[<div style="margin-bottom: 1em" id="wikiheader"><span style="font-size: 120%; font-weight: bold">UserGuide</span> &nbsp;
<div style="font-style: italic; margin-top: 3px">ExtBuilder User Guide</div>
</div>
<p>&nbsp;</p>
<ul>
    <li><a href="#Introduction">Introduction</a></li>
    <li><a href="#Installation">Installation</a></li>
    <ul>
        <li><a href="#Eclipse_3.x">Eclipse 3.x</a></li>
        <li><a href="#Apatana">Apatana</a></li>
    </ul>
    <li><a href="#Starting">Starting</a></li>
    <ul>
        <li><a href="#Kick_start">Kick start</a></li>
        <li><a href="#Overview">Overview</a></li>
    </ul>
    <li><a href="#How_to">How to</a></li>
    <ul>
        <li><a href="#Set_Properties">Set Properties</a></li>
        <li><a href="#Set_Layout">Set Layout</a></li>
        <li><a href="#"></a></li>
        <li><a href="#Toolbar">Toolbar</a></li>
        <li><a href="#Buttons">Buttons</a></li>
        <li><a href="#Grid">Grid</a></li>
        <li><a href="#Tree">Tree</a></li>
        <li><a href="#Listeners">Listeners</a></li>
        <li><a href="#Extension">Extension</a></li>
    </ul>
</ul>
<p>&nbsp;</p>
<h1><a name="Introduction">Introduction</h1>
<p>ExtBuilder is an eclipse plugin can help developer work out good style Ext javascript code without typing code. </p>
<h1><a name="Installation">Installation</h1>
<blockquote>
<h2><a name="Eclipse_3.x">Eclipse 3.x</h2>
</blockquote>
<ol>
    <li>make sure you eclipse version is 3.2,3.3 or 3.4 with GEF installed. </li>
    <li>download archived update site from <a href="http://code.google.com/p/extbuilder/downloads/list" rel="nofollow">http://code.google.com/p/extbuilder/downloads/list</a> </li>
    <li>Click Help-&gt;Software Updates-&gt;Find and Install...-&gt;Search for new features to install,Click Next </li>
    <li>Click New Archived Site-&gt; Browse to extbuilder_update.zip and click Open. </li>
    <li>Click OK and follow the instructions to install. </li>
    <li>Restart you eclipse </li>
</ol>
<blockquote>
<h2><a name="Apatana">Apatana</h2>
</blockquote>
<ol>
    <li>Install Apatanta as a plugin to Eclipse. </li>
    <li>Install ExtBuilder to Eclipse </li>
</ol>
<blockquote>Note: Apatana Studio removed some build-in plugins from Eclipse, such as GEF,icu,JDT,etc. If you definitely want to use Apatana Studio without eclipse, please install these plguins first. </blockquote>
<p>&nbsp;</p>
<h1><a name="Starting">Starting</h1>
<h2><a name="Kick_start">Kick start</h2>
<ol>
    <li>Click Windows-&gt;Preferences..-&gt;ExtJs Builder </li>
    <li>Click Browse button to select your Ext home directory. </li>
</ol>
<blockquote><img src="http://extbuilder.googlecode.com/svn/wiki/pref.png"  alt="" /> </blockquote>
<ol>
    <li>Click File-&gt;New, then select Web-&gt;ExtJs Page. a wizard dialog will appear. </li>
    <blockquote><img src="http://extbuilder.googlecode.com/svn/wiki/new_wizard.png"  alt="" /> </blockquote>
    <li>Click Next </li>
    <blockquote><img src="http://extbuilder.googlecode.com/svn/wiki/new_wizard2.png"  alt="" /> </blockquote>
    <li>Input the namespace you want </li>
    <li>Input class name you want, extbuilder create one class in one file, just like Java </li>
    <li>Input the file name, default is the class name </li>
    <li>Select super class, default is Ext.Panel, you also can create a window by select Ext.Window </li>
    <li>Click Finish. </li>
    <li>Then there are two files created in Package Explorer, for example: CorpSelectPanel.ext and CorpSelectPanel.js. The first file is used by extbuilder, the second file is the script file for you. </li>
</ol>
<h2><a name="Overview">Overview</h2>
<blockquote>Before you start to editing a Ext page, make sure you opened Outline View and Properties View. If not, please click Window-&gt;Show View to open these two views. </blockquote>
<p>&nbsp;</p>
<blockquote><img src="http://extbuilder.googlecode.com/svn/wiki/overview1.png"  alt="" /> <img src="http://extbuilder.googlecode.com/svn/wiki/overview2.png"  alt="" /> </blockquote>
<p>&nbsp;</p>
<blockquote>
<h3><a name="Editor_View">Editor View</h3>
It&#8217;s a multi-pages editor contains a source code editor and a UI editor. In source code editor, you can see the real code extbuilder generate for you. Please focus the initUIComponents function. In UI editor, you can see one palette at left side and a embedded browser at right side. With the embedded browser, you can preview the code generated by ExtBuilder. </blockquote>
<blockquote>
<h3><a name="Outline_View">Outline View</h3>
The outline view is a component tree view. You can select specific component in the view. </blockquote>
<blockquote>
<h3><a name="Properties_View">Properties View</h3>
The most important view you have to deal. In this view, you can set the configuration of one component. For example: For a Panel component, you may set the title property to &#8216;MyPanel&#8217;, the layout property to &#8216;Border&#8217;, the width property to &#8216;100&#8217;, etc. For a GridPanel component, you may set the store property and columns property. All you change make to a component take effect immediately. Both the code editor and UI editor will change. It&#8217;s a good way to watch your settings how change the UI to your wanted style. </blockquote>
<blockquote>
<h3><a name="Drag_Components">Drag Components</h3>
In UI editor, you can see a palette with some components in several folders. Now extbuilder supports most components in latest Ext 2.2 You could click one component, such as a Panel then move the mouse to outline view, there must be a component named panel, it's the root component of one panel class. Click the mouse again, then the root panel component now have a child panel. In the way, you can use any components and organize the component tree as you wish. Although you may think drag a component and drop it to a canvas is better, but that means ExtBuilder need to implement all Ext components drawing,behavior and layout in Java code. From my opinion, this way is the fastest way to build a GUI page. </blockquote>
<h1><a name="How_to">How to</h1>
<h2><a name="Set_Properties">Set Properties</h2>
<blockquote>Ext component have many properties. ExtBuilder divide these properties into two categories: common properties and advanced properties. By default, only common properties are shown,you can show advanced properties by click the Advanced button at the top toolbar of Properties View. Properties can be string, integer,drop down list. Some special properties like store, toolbar,buttons,columns Model will pop up a dialog for user set. </blockquote>
<h2><a name="Set_Layout">Set Layout</h2>
<blockquote>There are two panels, one parent, one child. </blockquote>
<ol>
    <li>Create a new Ext page </li>
    <li>Set the root panel's tilte to 'ParentPanel' </li>
    <li>Add a Panel to page root panel component </li>
    <li>Set the child panel's title to 'ChildPanel' </li>
    <li>Click the parent panel on outline view </li>
    <li>Set the parent panel's layout to 'Border' </li>
    <li>Click the child panel on outline view </li>
    <li>Set the child panel's region to 'center' </li>
</ol>
<blockquote>Because Ext border layout require a center region component, so when you set the layout to 'border', and not set the child panel's region to 'center', you may see some error message in browser, it's not a bug of ExtBuilder. <img src="http://extbuilder.googlecode.com/svn/wiki/layout.png"  alt="" /> <img src="http://extbuilder.googlecode.com/svn/wiki/region.png"  alt="" /> <img src="http://extbuilder.googlecode.com/svn/wiki/twopanel.png"  alt="" /> </blockquote>
<h2><a name="">FormPanel</h2>
<ol>
    <li>Create a new Ext page </li>
    <li>Add a FormPanel to root panel </li>
    <li>Set the FormPanel's layout to 'column' </li>
    <li>Add two Panels to FormPanel, set columnWidth to '.5' </li>
    <li>Set these two Panels's layout to 'form' </li>
    <li>Add 4 TextField to these Two Panel, each have two </li>
</ol>
<blockquote>Then you get a two column form panel </blockquote>
<blockquote><img src="http://extbuilder.googlecode.com/svn/wiki/formoutline.png"  alt="" /> <img src="http://extbuilder.googlecode.com/svn/wiki/form.png"  alt="" /> </blockquote>
<p>&nbsp;</p>
<h2><a name="Toolbar">Toolbar</h2>
<blockquote>Each Ext Panel has two toolbars, tbar and bbar. </blockquote>
<ol>
    <li>Click one Panel of Outline view. </li>
    <li>Click Properties view, scroll to tbar or bbar property </li>
    <li>Click the right side button '...' to show Toolbar Settings Dialog </li>
    <li>In Toolbar Settings Dialog, click Add Button(+) to add Button,Separator,Spacer,Fill,TextItem and MenuButton. Menu editing is not ready in current version. </li>
    <li>Change the text toolbar text, by default, the handler is as "onButtonTextClick". Of course, you can change the handler function name. </li>
    <li>Then switch to Source code Editor, see what happened. </li>
</ol>
<blockquote><img src="http://extbuilder.googlecode.com/svn/wiki/toolbar.png"  alt="" /> </blockquote>
<p>&nbsp;</p>
<pre class="prettyprint"><span class="pln">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;tbar </span><span class="pun">:</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">Ext</span><span class="pun">.</span><span class="typ">Toolbar</span><span class="pun">([{</span><span class="pln">&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; handler </span><span class="pun">:</span><span class="pln"> </span><span class="kwd">function</span><span class="pun">(</span><span class="pln">button</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">event</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="kwd">this</span><span class="pun">.</span><span class="pln">onButtonClick</span><span class="pun">(</span><span class="pln">button</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">event</span><span class="pun">);</span><span class="pln">&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="pun">}.</span><span class="pln">createDelegate</span><span class="pun">(</span><span class="kwd">this</span><span class="pun">),</span><span class="pln">&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; text </span><span class="pun">:</span><span class="pln"> </span><span class="str">"button"</span><span class="pln">&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="pun">}])</span></pre>
<blockquote>Look at this code block, I use a little trick. Because ExtBuilder need to show preview page for users, some javascript errors will make the preview page as blank page. So I have to make it runs fine when renderer ext components. You may need to write your own event handler function in your class. For example:
<pre class="prettyprint"><span class="pln">&nbsp; &nbsp; &nbsp; </span><span class="pun">...,</span><span class="pln">&nbsp;
&nbsp; &nbsp; &nbsp; onButtonClick </span><span class="pun">:</span><span class="pln"> </span><span class="kwd">function</span><span class="pun">(</span><span class="pln">button</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">event</span><span class="pun">){</span><span class="pln">&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="com">// your code here</span><span class="pln">&nbsp;
&nbsp; &nbsp; &nbsp; </span><span class="pun">}</span></pre>
</blockquote>
<h2><a name="Buttons">Buttons</h2>
<blockquote>Each Panel has one buttons property. Just same as Toolbar buttons editing except the component can add here is only Ext.Button. You can use buttonAlign to align button at left,right or center. </blockquote>
<h2><a name="Grid">Grid</h2>
<blockquote>ExtBuilder support three grid panels. GridPanel,PagingGridPanel and EditorGridPanel. PagingGridPanel is a gridpanel with paging toolbar on bottom. </blockquote>
<h3><a name="Store">Store</h3>
<blockquote><img src="http://extbuilder.googlecode.com/svn/wiki/store1.png"  alt="" /> <img src="http://extbuilder.googlecode.com/svn/wiki/store2.png"  alt="" /> </blockquote>
<blockquote>Store can take data from remote(HttpProxy) or local(MemoryProxy). Here is a example we use MemoryProxy to build grid. </blockquote>
<ol>
    <li>Click '...' button to show Store Settings Dialog </li>
    <li>Select MemoryProxy in Basic Page </li>
    <li>Click Sample button to generate some random data </li>
    <li>Click OK button to save store settings. </li>
    <li>Add loadData function in class </li>
    <pre class="prettyprint"><span class="pln">&nbsp; &nbsp; loadData </span><span class="pun">:</span><span class="pln"> </span><span class="kwd">function</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">&nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="kwd">this</span><span class="pun">.</span><span class="pln">store1</span><span class="pun">.</span><span class="pln">load</span><span class="pun">();</span><span class="pln">&nbsp;
    &nbsp; &nbsp; </span><span class="pun">}</span></pre>
</ol>
<blockquote>here store1 is the component name of store. </blockquote>
<ol>
    <li>Add code in class constructor function </li>
    <pre class="prettyprint"><span class="pln">&nbsp; &nbsp; &nbsp;system</span><span class="pun">.</span><span class="typ">CorpSelectPanel</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">function</span><span class="pun">(</span><span class="pln">config</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">&nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="typ">Ext</span><span class="pun">.</span><span class="pln">applyIf</span><span class="pun">(</span><span class="kwd">this</span><span class="pun">,</span><span class="pln"> config</span><span class="pun">);</span><span class="pln">&nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="kwd">this</span><span class="pun">.</span><span class="pln">initUIComponents</span><span class="pun">();</span><span class="pln">&nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; system</span><span class="pun">.</span><span class="typ">CorpSelectPanel</span><span class="pun">.</span><span class="pln">superclass</span><span class="pun">.</span><span class="pln">constructor</span><span class="pun">.</span><span class="pln">call</span><span class="pun">(</span><span class="kwd">this</span><span class="pun">);</span><span class="pln">&nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="com">//load store data here</span><span class="pln">&nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="kwd">this</span><span class="pun">.</span><span class="pln">loadData</span><span class="pun">();</span><span class="pln">&nbsp;
    &nbsp; &nbsp; &nbsp;</span><span class="pun">};</span></pre>
</ol>
<p>&nbsp;</p>
<blockquote>
<p>Now, you can see the data at preview page. <img src="http://extbuilder.googlecode.com/svn/wiki/grid1.png"  alt="" /> </p>
<p><br />
&nbsp;</p>
</blockquote></a>
 <img src ="http://www.blogjava.net/liubijin/aggbug/320009.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/liubijin/" target="_blank">無所謂</a> 2010-05-04 11:20 <a href="http://www.blogjava.net/liubijin/archive/2010/05/04/320009.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ExtJS Record 与 Store 说明</title><link>http://www.blogjava.net/liubijin/archive/2010/05/04/320008.html</link><dc:creator>無所謂</dc:creator><author>無所謂</author><pubDate>Tue, 04 May 2010 03:18:00 GMT</pubDate><guid>http://www.blogjava.net/liubijin/archive/2010/05/04/320008.html</guid><wfw:comment>http://www.blogjava.net/liubijin/comments/320008.html</wfw:comment><comments>http://www.blogjava.net/liubijin/archive/2010/05/04/320008.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/liubijin/comments/commentRss/320008.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/liubijin/services/trackbacks/320008.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: １、Record　　首先需要明确是，ExtJS中有一个名为Record的类，表格等控件中使用的数据是存放在Record对象中，一个Record可以理解为关系数据表中的一行，也可以称为记录。Record对象中即包含了记录（行中各列）的定义信息（也就是该记录包含哪些字段，每一个字段的数据类型等），同时又包含了记录具体的数据信息（也就是各个字段的值）。　　我们来看直接使用Record的代码：...&nbsp;&nbsp;<a href='http://www.blogjava.net/liubijin/archive/2010/05/04/320008.html'>阅读全文</a><img src ="http://www.blogjava.net/liubijin/aggbug/320008.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/liubijin/" target="_blank">無所謂</a> 2010-05-04 11:18 <a href="http://www.blogjava.net/liubijin/archive/2010/05/04/320008.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ExtJS+DWR+Spring+Hibernate开发HRMS</title><link>http://www.blogjava.net/liubijin/archive/2010/05/04/320007.html</link><dc:creator>無所謂</dc:creator><author>無所謂</author><pubDate>Tue, 04 May 2010 03:14:00 GMT</pubDate><guid>http://www.blogjava.net/liubijin/archive/2010/05/04/320007.html</guid><wfw:comment>http://www.blogjava.net/liubijin/comments/320007.html</wfw:comment><comments>http://www.blogjava.net/liubijin/archive/2010/05/04/320007.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/liubijin/comments/commentRss/320007.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/liubijin/services/trackbacks/320007.html</trackback:ping><description><![CDATA[<p>http://blog.csdn.net/lenotang/archive/2008/10/02/3009532.aspx<br />
http://blog.csdn.net/lenotang/archive/2008/10/02/3009575.aspx<br />
http://blog.csdn.net/lenotang/archive/2008/10/02/3009685.aspx<br />
http://blog.csdn.net/lenotang/archive/2008/10/02/3009688.aspx<br />
http://blog.csdn.net/lenotang/archive/2008/10/02/3009692.aspx</p>
<img src ="http://www.blogjava.net/liubijin/aggbug/320007.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/liubijin/" target="_blank">無所謂</a> 2010-05-04 11:14 <a href="http://www.blogjava.net/liubijin/archive/2010/05/04/320007.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Ext-API详解</title><link>http://www.blogjava.net/liubijin/archive/2010/05/04/320005.html</link><dc:creator>無所謂</dc:creator><author>無所謂</author><pubDate>Tue, 04 May 2010 03:11:00 GMT</pubDate><guid>http://www.blogjava.net/liubijin/archive/2010/05/04/320005.html</guid><wfw:comment>http://www.blogjava.net/liubijin/comments/320005.html</wfw:comment><comments>http://www.blogjava.net/liubijin/archive/2010/05/04/320005.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/liubijin/comments/commentRss/320005.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/liubijin/services/trackbacks/320005.html</trackback:ping><description><![CDATA[<p>&nbsp;</p>
<p>1、Ext.apply(Object obj, Object config, Object defaults ) : Object<br />
将config中的所有属性复制到obj中，如果配置了defaults，则先将defaults中的属性传入obj，然后再将config中属性传入，一般defaults用于定义一些默认值。<br />
注意：每个参数都必须是对象object，而不能是function或其他。<br />
创建object可以通过new function(){}、new Object()、{}等方法创建。</p>
<p>2、Ext.emptyFn: Function <br />
用于返回一个空函数，便于在程序中创建空函数。Ext.emptyFn返回function(){}</p>
<p>3、Ext.applyIf(Object obj, Object config) : Object功能如同Ext.apply,但是只把config中存在而obj不存在的属性复制过去。</p>
<p>4、Ext.addBehaviors( Object obj ) : void为页面中一个或多个元素添加事件 <br />
元素使用css规则查找，其中元素与事件用@隔开 Ext.addBehaviors({<br />
&nbsp;&nbsp; //为id为foo的元素下的所有a元素添加click事件<br />
&nbsp;&nbsp; '#foo a@click' : function(e, t){<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // do something<br />
&nbsp;&nbsp; },<br />
&nbsp;&nbsp; // 为多个选择器添加相同的事件(mouseover)。在@之前使用逗号分开<br />
&nbsp;&nbsp; '#foo a, #bar span.some-class@mouseover' : function(){<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // do something<br />
&nbsp;&nbsp; }<br />
});<br />
5、Ext.id( [Mixed el], [String prefix] ) : String&nbsp; <br />
返回一个唯一的id值。<br />
如果只需要获取一个唯一的id值，则直接调用Ext.id()；<br />
如果需要为某个元素设定一个唯一的id值并返回id则调用Ext.id(el)，el为元素Id、Dom对象或Ext的Element对象。<br />
如果需要指定特定的前缀，则需要传入第二个参数，如Ext.id(el,&#8221;myPrix-&#8221;)，默认前缀为ext-gen，如默认返回id可能为ext-gen4，指定了前缀后可能返回myPrix-4。</p>
<p>6、Ext.extend( Object subclass, Object superclass, [Object overrides] ) : void实现对象继承，目前还不太了解具体原理 ？？？</p>
<p>7、Ext.namespace( String namespace1, String namespace2, String etc ) : void<br />
创建命名空间：<br />
如Ext.namespace("Company","MyNS.mydata","Data.format.string")<br />
然后可以创建如MyNS.mydata.doit=function(){&#8230;}的接口<br />
注：命名空间的简易调用：Ext.ns()，在Ext Api中未给出此用法。</p>
<p>8、Ext.urlEncode( Object o ) : String将一个json对象转换称url参数串，支持通过数组为一个参数设定多个值。<br />
如将{a:1,b:2,c:[1,3,5,7]}转换为a=1&amp;b=2&amp;c=1&amp;c=3&amp;c=5&amp;c=7</p>
<p>9、Ext.urlDecode( String string, [Boolean overwrite] ) : Object将url参数串转换为json对象，overwrite如果为true，则后面的同名参数值覆盖前面的同名参数值（默认为false即不覆盖而以数组形式返回）。<br />
如 Ext.urlDecode("a=1&amp;b=2&amp;c=1&amp;c=3&amp;c=5&amp;c=7")<br />
返回的对象内容为{a:1,b:2,c:[1,3,5,7]}<br />
Ext.urlDecode("a=1&amp;b=2&amp;c=1&amp;c=3&amp;c=5&amp;c=7",true)<br />
返回{a:1,b:2,c:7}</p>
<p>10、Ext.each( Array/NodeList/Mixed array, Function fn, Object scope ) : void遍历array并对每项分别调用fn函数。如果array不是数组则只执行一次。<br />
如果某项fn执行结果返回false（必须是false，undefined无效），遍历退出，后面的array项将不被遍历。<br />
遍历过程中每次为fn传入参数分别为[当前数组项]，[当前索引]和[数组array]三个参数。<br />
Scope用于设定fn函数中的this指针。<br />
如 Ext.each([1,3,5,7],function(v,i,a){<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alert("index: "+i+" value: "+v+" array.length："+a.length)<br />
});<br />
将循环弹出：<br />
index:0 value:1 array.length：4<br />
index:1 value:3 array.length：4&nbsp; <br />
index:2 value:5 array.length：4&nbsp; <br />
index:3 value:7 array.length：4 Ext.each([1,3,5,7],function(v,i,a){<br />
&nbsp;&nbsp;&nbsp; alert("index: "+i+" value: "+v+" array.length："+a.length);<br />
&nbsp;&nbsp;&nbsp; return v!=5;&nbsp; //到第三项后遍历退出<br />
});</p>
<p>将循环弹出：<br />
index:0 value:1 array.length：4<br />
index:1 value:3 array.length：4&nbsp; <br />
index:2 value:5 array.length：4&nbsp; </p>
<p>11、Ext.combine(arg1,arg2..argn) : Array&nbsp;&nbsp;&nbsp; //该方法在Ext2不推荐再使用<br />
用于实现对数组的合并，如果是字符串则作为只有一项的数组合并。<br />
如 var a1=[1,3,5],b1=["a","b","c"];var c1="xxyznbde";<br />
Ext.combine(a1,b1,c1) 返回[1,3,5,a,b,c,xxyznbde]</p>
<p>12、Ext. escapeRe( String str ) : String<br />
将属于正则里的特殊字符进行转义。<br />
如 Ext.escapeRe("(ab)$\sa342{}[dd]")将返回\(ab\)\$sa342\{\}\[dd\]。</p>
<p>13、Ext.callback(cb, scope, args, delay) :void&nbsp; //该方法为Ext的内部方法<br />
调用一个函数或延迟调用一个函数。<br />
Cb:调用的函数。<br />
scope:cb中this指针。<br />
args：传如cb的参数，以数组形式表示。<br />
delay：延迟多少毫秒执行cb。<br />
如 Ext.callback(function(x,y){alert(x+y)},this,[3,5],1000);将于1秒钟后弹出8，即3+5的结果。</p>
<p>14、Ext.getDom( Mixed el ) : HTMLElement根据传入的id/dom节点/Ext的Elemenet对象，返回其dom对象。<br />
如alert(Ext.getDom("a").innerHTML);或<br />
alert(Ext.getDom(document.getElementById("a")).innerHTML);<br />
将返回id为a的元素的innerHTML内容。</p>
<p>15、Ext.getDoc()/Ext.getBody() : Ext.Element分别返回页面的document对象和body对象，返回值为Ext的Element对象，而非Dom对象。 </p>
<p>16、Ext.getCmp( String id ) : Ext.Component根据传入的html元素id返回该元素的组件类型，返回值为Ext的Component对象。<br />
必须保证该id对象的元素是Ext的一个内部组件（通过Ext创建的组件），否则什么都不返回。</p>
<p>17、Ext.num( Mixed value, Number defaultValue ) : Number<br />
验证value是否是一个数字，如果是则直接返回否则返回defaultValue。<br />
如 alert(Ext.num(5,7))返回5，alert(Ext.num("5",7)) 返回7</p>
<p>18、Ext.destroy( Mixed arg1, Mixed (optional), Mixed (optional) ) : void销毁创建的Element或组件(Component)，即销毁其所有的事件监听，dom节点，并调用对象本身的destory方法（如果存在的话），传入的参数类型为Ext.Element或Ext. Component，可以一次性传入多个对象进行销毁。<br />
如 Ext.destory(menu,el,Button);会销毁menu,el,Button三个对象。</p>
<p>19、Ext.removeNode(htmlElement el): void&nbsp; //Ext内部方法<br />
删除指定的dom节点。传入参数为dom对象。<br />
如 Ext.removeNode(document.getElementById("ab"));</p>
<p>20、Ext.type( Mixed object ) : String返回传入的对象的类型。<br />
包括如下类型：<br />
string,number,boolean,function,object,array,regexp,element,nodelist,textnode,whitespace<br />
如 Ext.type("ab")返回string<br />
Ext.type(20)返回number<br />
Ext.type([3,5,6])返回array<br />
Ext.type(/reg/)返回regexp<br />
Ext.type(document.body)返回element。</p>
<p>21、Ext.isEmpty( Mixed value, [Boolean allowBlank] ) : Boolean检查一个值是否为null/undefined或是否是空，如果是则返回true。<br />
如果传入allowBlank为true，则只检查是否为null或undefined。<br />
如： Ext.isEmpty("a")返回false，<br />
Ext.isEmpty("")返回true，<br />
Ext.isEmpty("",true)返回false，<br />
Ext.isEmpty(null)返回true。</p>
<p>22、Ext.value(String v,String defaultValue[,[Boolean allowBlank]):String&nbsp; //Ext内部方法<br />
检查v是否是为null/undefined或空，如果是则返回defaultValue，否则返回v。如果allowBlank参数为true，则允许v为空（即当v为空时不返回defaultValue而返回空）。&nbsp; </p>
<p>Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1901694</p>
<img src ="http://www.blogjava.net/liubijin/aggbug/320005.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/liubijin/" target="_blank">無所謂</a> 2010-05-04 11:11 <a href="http://www.blogjava.net/liubijin/archive/2010/05/04/320005.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>