Sha256: 2f3b2f2d03c21112736bf53272e37b35c3193ac7f8c3ddfcfadfa0feb21c74c0

Contents?: true

Size: 1.46 KB

Versions: 1

Compression:

Stored size: 1.46 KB

Contents

module Netzke
  module Basepack
    class GridPanel < Netzke::Base
      class SearchWindow < Netzke::Basepack::Window

        action :search
        action :cancel
        action :clear, :icon => :application_form
        
        js_properties :title => "Advanced Search", 
                      :width => "50%",
                      :auto_height => true,
                      :buttons => [:search.action, :cancel.action],
                      :tbar => [:clear.action]
        
        config :items => [js_component(:search_panel)]
        
        component :search_panel do
          {
            :class_name => "Basepack::SearchPanel", 
            :model => config[:model],
            :items => config[:fields]
          }
        end

        js_method :on_clear, <<-JS
          function(){
            this.items.first().getForm().reset();
          }
        JS

        js_method :on_search, <<-JS
          function(){
            this.conditions = this.items.first().getForm().getValues();
            
            // do not send values of empty values
            for (var cond in this.conditions) {
              if (this.conditions[cond] == "") delete this.conditions[cond];
            }
            
            this.closeRes = 'OK'; 
            this.close();
          }
        JS
        
        js_method :on_cancel, <<-JS
          function(){
            this.closeRes = 'cancel'; 
            this.close();
          }
        JS
        
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
netzke-basepack-0.6.0 app/components/netzke/basepack/grid_panel/search_window.rb