﻿<?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-大道天成-随笔分类-ExtJS</title><link>http://www.blogjava.net/rockblue1988/category/52609.html</link><description>好好学习，天天向上</description><language>zh-cn</language><lastBuildDate>Wed, 12 Sep 2012 09:44:35 GMT</lastBuildDate><pubDate>Wed, 12 Sep 2012 09:44:35 GMT</pubDate><ttl>60</ttl><item><title>ExtJS运用cookie保存登录信息</title><link>http://www.blogjava.net/rockblue1988/archive/2012/09/12/387575.html</link><dc:creator>Jimi Hendrix</dc:creator><author>Jimi Hendrix</author><pubDate>Wed, 12 Sep 2012 09:23:00 GMT</pubDate><guid>http://www.blogjava.net/rockblue1988/archive/2012/09/12/387575.html</guid><wfw:comment>http://www.blogjava.net/rockblue1988/comments/387575.html</wfw:comment><comments>http://www.blogjava.net/rockblue1988/archive/2012/09/12/387575.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/rockblue1988/comments/commentRss/387575.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/rockblue1988/services/trackbacks/387575.html</trackback:ping><description><![CDATA[项目上有一个这样的需求：登录的时候选择一个单位名称，然后输入账号完成登录，下次登录的时候，&#8220;单位选择&#8221;框里自动显示为上次登录的页面。<br />具体实现如下：<br /><br /><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div><span style="white-space:pre">			</span>xtype : 'combo', &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//这里是选择单位的Combo</div><div><span style="white-space:pre">			</span>id:'orgname',</div><div><span style="white-space:pre">			</span>store : orgStore,</div><div><span style="white-space:pre">			</span>name:'orgname',</div><div><span style="white-space:pre">			</span>emptyText : '请选择单位',</div><div><span style="white-space:pre">			</span>displayField : 'orgname',</div><div><span style="white-space:pre">			</span>valueField : 'dbname',</div><div><span style="white-space:pre">			</span>editable : false,</div><div><span style="white-space:pre">			</span>forceSelection : true,</div><div><span style="white-space:pre">			</span>triggerAction : 'all',</div><div><span style="white-space:pre">			</span>shadow : 'frame',</div><div><span style="white-space:pre">			</span>hiddenName : 'dbname',</div><div><span style="white-space:pre">			</span>listeners:{</div><div>&nbsp; &nbsp; <span style="white-space:pre">		        </span>select:function(){ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//增加1个select函数，当选择的时候，将选择结果保存入cookie</div><div>&nbsp; &nbsp; <span style="white-space:pre">			         </span>savedbname=<span style="white-space:pre">	</span>Ext.getCmp('orgname').getValue();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Ext.util.Cookies.set('savedbname',savedbname);</div><div><span style="white-space:pre">			</span>}</div><div>&nbsp; &nbsp; <span style="white-space:pre">	</span>}</div><div><span style="white-space:pre">		</span>}</div><br /><br /><br />&nbsp;<br /><div><span style="white-space:pre">	</span>var orgStore = new Ext.data.JsonStore( { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //这是单位选择Combo的数据源</div><div><span style="white-space:pre">		</span>url : 'test/LoginOrgSelectServlet',</div><div><span style="white-space:pre">		</span>root : 'orgselect',</div><div><span style="white-space:pre">		</span>fields : [ 'orgname', 'dbname' ],</div><div><span style="white-space:pre">		</span>autoLoad : true,</div><div><span style="white-space:pre">		</span>listeners:{load:function(){ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//给store添加一个load监听器</div><div><span style="white-space:pre">		</span> &nbsp; var cookiedata = Ext.util.Cookies.get("savedbname");</div><div><span style="white-space:pre">		</span> &nbsp; if (cookiedata!=null){Ext.getCmp('orgname').setValue(cookiedata);} &nbsp; //当cookie中的数据不为空的时候，设置combo的值</div><div><span style="white-space:pre">		</span>}}</div><div><span style="white-space:pre">	</span>});</div><img src ="http://www.blogjava.net/rockblue1988/aggbug/387575.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/rockblue1988/" target="_blank">Jimi Hendrix</a> 2012-09-12 17:23 <a href="http://www.blogjava.net/rockblue1988/archive/2012/09/12/387575.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ExtJS 导出 Excel</title><link>http://www.blogjava.net/rockblue1988/archive/2012/02/29/370977.html</link><dc:creator>Jimi Hendrix</dc:creator><author>Jimi Hendrix</author><pubDate>Wed, 29 Feb 2012 03:21:00 GMT</pubDate><guid>http://www.blogjava.net/rockblue1988/archive/2012/02/29/370977.html</guid><wfw:comment>http://www.blogjava.net/rockblue1988/comments/370977.html</wfw:comment><comments>http://www.blogjava.net/rockblue1988/archive/2012/02/29/370977.html#Feedback</comments><slash:comments>6</slash:comments><wfw:commentRss>http://www.blogjava.net/rockblue1988/comments/commentRss/370977.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/rockblue1988/services/trackbacks/370977.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 这两天项目上要求做一个导出Excel的功能，项目前台用的ExtJS,后台用的JAVA，网上查了查，大概有3种做法。1.apache公司提供的POI2.韩国公司的JXL3.据说是官方提供的JS调用方法前两种都要引入外包，懒得找包了，采用了第三种，所需引入JS代码如下：/Files/rockblue1988/export.txt&nbsp;Code highlighting produced by A...&nbsp;&nbsp;<a href='http://www.blogjava.net/rockblue1988/archive/2012/02/29/370977.html'>阅读全文</a><img src ="http://www.blogjava.net/rockblue1988/aggbug/370977.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/rockblue1988/" target="_blank">Jimi Hendrix</a> 2012-02-29 11:21 <a href="http://www.blogjava.net/rockblue1988/archive/2012/02/29/370977.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>