Skip to content

mouse-lin/dynamic_grids

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DynamicGrids(wando)
============

#在你的Gemfile 添加上composite_primary_keys
gem 'composite_primary_keys', '=3.1.0'
#获取需要的辅助插件
plugins provider

#创建dynamic_grid 需要用到的数据
rails generate create_dynamic_grid


#添加必要的Js文件到application中
<%= javascript_include_tag 'dynamic_grids_js/dynamic_grids.js' %>	


#ExtJs 文件中的使用方式:
  var grid = new Wando.grid.DynamicGridPanel({ 
      storeUrl: 'controllers/actions',
      columnsConfig: {
         header_column_name: {width: 1000, renderer: some_render_action } #example
      },
  })

#Rails controller 使用方式:
  def dynamic_grids
    dynamic_grids Model,grid_name,option
  end

#跨表获取字段,倘若在需要获取的表头项不在表内,请参考provider使用方式来赋值Headers的index
order 表
Order(id: integer, name: string)  
order_item 表
order_item(id: integer, order_id: integer, name: string)
#通过order需要获取order_item的name,header的写法 
Header.create(:index => "order_item/name")


Example
=======

Example goes here.

Copyright (c) 2011 [name of plugin creator], released under the MIT license

About

动态grid(ExtJs实现前台)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published