leikind / wice_grid

A Rails grid plugin to create grids with sorting, pagination, and (automatically generated) filters
MIT License
537 stars 213 forks source link

Custom styling for wicegrid 3.0.4 #221

Closed clubbavi closed 9 years ago

clubbavi commented 9 years ago

Hello,

I am using wicegrid 3.0.4 with rails 3. I want to do a custom styling. I added ":html => {:style => 'text-align: center'} or html: {style: 'text-align: center'}" as:

g.column :column_name => "Name", :attribute_name => 'name', html: {style: 'text-align: center'}"

Thanks.

leikind commented 9 years ago

Can you post the whole grid definition?

clubbavi commented 9 years ago

Code Snippet:

 <%= grid(@list) do |g|
   g.column :column_name => "Name", :attribute_name => 'name'
   g.column :column_name => "Size", :attribute_name => 'size', html: {style: 'text-align: center'}
 end -%>

It gives me "Unknown key:html" error.

leikind commented 9 years ago

You are using a version from 2011 https://rubygems.org/gems/wice_grid/versions and using documentation for the latest version. There is no html in 3.0.4. Read the docs inside the gem.

clubbavi commented 9 years ago

What is the attribute to use styling in wicegrid 3.04 ?

leikind commented 9 years ago

Read the docs inside the gem.

clubbavi commented 9 years ago

Ok got it. Have to use like this :

:td_html_attrs => {:style => 'text-align: right'}

Thanks