lib/netzke/grid.rb in skozlov-netzke-basepack-0.1.0.1 vs lib/netzke/grid.rb in skozlov-netzke-basepack-0.1.1

- old
+ new

@@ -16,12 +16,14 @@ # define connection points between client side and server side of Grid. See implementation of equally named methods in the GridInterface module. interface :get_data, :post_data, :delete_data, :resize_column, :move_column, :get_cb_choices def initial_config { - :ext_config => {:properties => true}, - :layout_manager => "NetzkeLayout" + :ext_config => {:properties => true, :column_filters => true}, + :layout_manager => "NetzkeLayout", + :column_resize => true, + :column_move => true } end def property_widgets [{ @@ -52,23 +54,9 @@ def properties__general__load_source(params = {}) w = aggregatee_instance(:properties__general) w.interface_load_source(params) end - # we pass column config at the time of instantiating the JS class - def js_config - res = super - res.merge!(:columns => get_columns || config[:columns]) # first try to get columns from DB, then from config - res.merge!(:data_class_name => config[:data_class_name]) - res - end - - def js_listeners - super.merge({ - :columnresize => (config[:column_resize] ? {:fn => "this.onColumnResize".l, :scope => this} : nil), - :columnmove => (config[:column_move] ? {:fn => "this.onColumnMove".l, :scope => this} : nil) - }) - end protected def layout_manager_class \ No newline at end of file