lib/netzke/grid_panel_extras/interface.rb in netzke-basepack-0.3.7 vs lib/netzke/grid_panel_extras/interface.rb in netzke-basepack-0.3.8
- old
+ new
@@ -138,10 +138,30 @@
output_array.total_records = total_records_count
output_array
end
- # TODO: document me!
+ #
+ # Converts Ext.grid.GridFilters filters to searchlogic conditions, e.g.
+ # {"0" => {
+ # "data" => {
+ # "type" => "numeric",
+ # "comparison" => "gt",
+ # "value" => 10 },
+ # "field" => "id"
+ # },
+ # "1" => {
+ # "data" => {
+ # "type" => "string",
+ # "value" => "pizza"
+ # },
+ # "field" => "food_name"
+ # }}
+ #
+ # =>
+ #
+ # {"id_gt" => 100, "food_name_contains" => "pizza"}
+ #
def convert_filters(column_filter)
res = {}
column_filter.each_pair do |k,v|
field = v["field"]
case v["data"]["type"]
\ No newline at end of file