lib/controller/ext.rb in lipsiadmin-4.1.8 vs lib/controller/ext.rb in lipsiadmin-5.0.0

- old
+ new

@@ -103,11 +103,13 @@ # Reformat dataIndex options[:mapping] ||= options[:dataIndex].to_s.downcase.gsub(/[^a-z0-9]+/, '_'). gsub(/-+$/, '_'). gsub(/^-+$/, '_') - + # Now is necessary for our columns an ID + options[:id] = options[:mapping] + @data << options end # Return an array config for build an Ext.grid.ColumnModel() config def column_fields @@ -123,11 +125,11 @@ # Return an array config for build an Ext.data.GroupingStore() def store_fields @data.inject([]) do |fields, data| hash = { :name => data[:dataIndex], :mapping => data[:mapping] } - hash.merge!(:type => data[:renderer]) if data[:renderer] && - (data[:renderer] == :date || data[:renderer] == :datetime) + hash.merge!(:type => data[:renderer]) if data[:renderer] && + (data[:renderer] == :date || data[:renderer] == :datetime || data[:renderer] == :time_to_date) fields << hash fields end end \ No newline at end of file