Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable customization of <td> #43

Closed
gmile opened this issue Aug 23, 2012 · 5 comments
Closed

Enable customization of <td> #43

gmile opened this issue Aug 23, 2012 · 5 comments

Comments

@gmile
Copy link

gmile commented Aug 23, 2012

Currently, I found no way to set my own class on a <td>. Maybe there's a workaround? I believe an ability to specify custom classes on a <td> should be extremely useful in some cases.

Per investigation I found no way to specify arbitrary class on a column. See the chain:

  1. _row.html.erb
  2. #datagrid_column_classes

Going even further, I believe datagrid should allow full customization of <td>'s html attributes. Among the most popular attributes there are id, title, data- and others.

@bogdan
Copy link
Owner

bogdan commented Sep 1, 2012

For some people, the following will fork great:

rake datagrid:copy_partials

May be it's true, that we need to make all html attributes configurable. But what API can you propose to make it fully configurable?

@Fivell
Copy link

Fivell commented Jan 15, 2014

But what API can you propose to make it fully configurable?

What about next DSL

column :status, :header => "Status", :html_options => proc {|row|   {'class' => row.status,  'data-id' => row.id  }     }  do |row|
  row.activated?
end

@bogdan
Copy link
Owner

bogdan commented Jan 15, 2014

@Fivell
Good enough, but I would prefer html_attributes instead of html_options.
You can send a PR if you are interested.

@Fivell
Copy link

Fivell commented Jan 15, 2014

@bogdan , I don't think I have time to do it soon, maybe in future.

@bogdan
Copy link
Owner

bogdan commented Jul 20, 2014

This seems to be solvable in many other ways so I am closing this one.

@bogdan bogdan closed this as completed Jul 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants