lib/ui_bibz/ui/ux/table/table.rb in ui_bibz-2.0.0.alpha10 vs lib/ui_bibz/ui/ux/table/table.rb in ui_bibz-2.0.0.alpha11
- old
+ new
@@ -30,15 +30,15 @@
# * +tap+ - Boolean
# * +actionable+ - Boolean
# * +sortable+ - Boolean
# * +searchable+ - Boolean
# * +default_actions+ - Boolean
- # * +state+
+ # * +status+
# (+:inverse+, +:default+, +:success+, +:primary+, +:secondary+, +:info+,
# +:danger+, +:warning+)
# * +thead+ - Hash
- # (+state+)
+ # (+status+)
# (+:inverse+, +:default+)
# * +bordered+ - Boolean
# * +hoverable+ - Boolean
# * +size+
# (+:sm+)
@@ -65,14 +65,14 @@
# UiBibz::Ui::Ux::Table.new(store: @users).tap do |t|
# t.columns do |c|
# c.column :id, { name: '#' }
# c.column :name_fr', { link: edit_user_path(:id), order: 2 }
# c.column :name_en'
- # c.column :status_id, { name: 'Status', format: lambda{ |records, record| "Test #{ record.id}"} }
+ # c.column :state_id, { name: 'state', format: lambda{ |records, record| "Test #{ record.id}"} }
# end
# t.actions do |a|
- # a.link 'toto', url: users_path(:id), glyph: 'eye'
+ # a.link 'state', url: users_path(:id), glyph: 'eye'
# a.divider
# a.link 'momo', url: users_path(:id), glyph: 'home'
# end
# end.render
#
@@ -182,22 +182,22 @@
content = col.count ? record.send(col.data_index).count : record.send(col.data_index)
unless content.nil?
content = content.strftime(col.date_format) unless col.date_format.nil?
content = link_to content, action.inject_url(col.link, record) unless col.link.nil?
content = col.format.call(@store.records, record) unless col.format.nil?
- content = As.new(col, record, content).render unless col.as.nil?
- content
end
+ content = As.new(col, record, content, @options).render unless col.as.nil?
+ content
end
private
def component_html_classes
["table", striped, bordered, hoverable, size, responsive, reflow]
end
- def state
- "table-#{ @options[:state] }" unless @options[:state].nil?
+ def status
+ "table-#{ @options[:status] }" unless @options[:status].nil?
end
def striped
"table-striped" unless @options[:striped].nil?
end