Sha256: 2b448f65558255698450cd3ab0ba6337899d403c75c6f54ed3236033fb5a9bed

Contents?: true

Size: 1.11 KB

Versions: 2

Compression:

Stored size: 1.11 KB

Contents

module Netzke::GridPanelExtras
  class RecordFormWindow < Window
    def actions
      {:ok => {:text => "OK"}, :cancel => {:text => "Cancel"}}
    end
    
    def initial_config
      super.deep_merge({
        :ext_config => {
          :modal => true,
          :width => "60%",
          :height => "90%",
          :fbar => [:ok, :cancel]
        }
      })
    end
    
    def self.js_extend_properties
      {
        :button_align => "right",
        
        :init_component => <<-END_OF_JAVASCRIPT.l,
          function(){
            #{js_full_class_name}.superclass.initComponent.call(this);
            this.getWidget().on("submitsuccess", function(){this.closeRes = "ok"; this.close();}, this);
          }
        END_OF_JAVASCRIPT
        
        :on_ok => <<-END_OF_JAVASCRIPT.l,
          function(){
            this.getWidget().onApply();
            // this.closeRes = "ok",
            // this.close();
          }
        END_OF_JAVASCRIPT
        
        :on_cancel => <<-END_OF_JAVASCRIPT.l,
          function(){
            this.close();
          }
        END_OF_JAVASCRIPT
        
      }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
netzke-basepack-0.5.5.1 lib/netzke/grid_panel_extras/record_form_window.rb
netzke-basepack-0.5.5 lib/netzke/grid_panel_extras/record_form_window.rb