- Easy to include ext files
- Pagination
- Scaffold
- Tree (Not implemented yet)
- and so on (Not implemented yet)
cd vendor/plugins svn co http://wota.jp/svn/rails/plugins/trunk/ext/2)安装依赖的plugins:
ruby script/plugin install http://wota.jp/svn/rails/plugins/branches/stable/dsl_accessor/ ruby script/plugin install http://wota.jp/svn/rails/plugins/branches/stable/named_options/3)安装extjs库 此处下载最新版的ExtJs,有三个adapter: jquery, prototype, yui wget http://extjs.com/deploy/ext-1.0.1a.zip unzip ext-1.0.1a.zip cd public ln -s ../ext-1.0.1a ext 基于Windows的用户可将ext-1.0.1a.zip直接展开到public目录,然后将目录ext-1.0.1a更名为ext。 2、修改ExtJs Plugin 该plugin是基于ext-1.0-alpha3而作的,稍加修改即可支持最新版ext-1.0.1a。 打开文件vendor/plugins/ext/lib/ext/helper.rb,将ext_include方法修改为:
ruby 代码
- def ext_include
- array = []
- array << class="string">"#{ext_top}resources/css/ext-all")
- array << class="string">"#{ext_top}adapter/yui/yui-utilities")
- array << class="string">"#{ext_top}adapter/yui/ext-yui-adapter")
- if RAILS_ENV == 'development'
- array << class="string">"#{ext_top}ext-all-debug")
- else
- array << class="string">"#{ext_top}ext-all")
- end
- array <<>
- array <<>
- array.join("\n")
- end
ruby 代码
- create_table :tomcats do |t|
- t.column :kname, :string
- t.column :memo, :text
- end
ruby 代码
- class TomcatsController <>
- ext_paginate Tomcat, 20,
- :cm => Ext::Grid::ColumnModel.new([
- {:dataIndex => "id" , :width => 100, :header => "Thread ID"},
- {:dataIndex => "kname" , :width => 200, :header => "Title"},
- {:dataIndex => "memo" , :width => 400, :header => "Description"},
- ])
- end
- Ext Plugin: http://wota.jp/ac/?date=20070406
- ExtJs: http://extjs.com/
没有评论:
发表评论