Sha256: 6f238a4d2c9856fc23795cec2984f831be78e8a8ef6972ee9f64456ab42f0841

Contents?: true

Size: 1.22 KB

Versions: 12

Compression:

Stored size: 1.22 KB

Contents

module Netzke
  #
  # Ext.grid.PropertyGrid
  #
  class PropertyGrid < Base
    interface :load_source, :submit_source
    
    def initialize(*args)
      super
      @config = {:ext_config => {}}.merge(@config)
    end

    def js_base_class
      "Ext.grid.PropertyGrid"
    end

    def actions
      [{
        :text => 'Apply', :handler => 'submit'
      }]
    end

    def js_default_config
      super.merge({
        :bbar => "config.actions".l
      })
    end
    
    def js_extend_properties
      {
        :submit => <<-JS.l,
        function() {
          Ext.Ajax.request({
            url:this.initialConfig.interface.submitSource,
            params:{data:Ext.encode(this.getSource())},
            scope:this
          })
        }
        JS
        :on_widget_load => <<-JS.l,
        function(){
          this.loadSource()
        }
        JS
        :load_source => <<-JS.l,
          function(){Ext.Ajax.request({
            url:this.initialConfig.interface.loadSource,
            success:function(r){
              var m = Ext.decode(r.responseText);
      				this.setSource(m.source);
              // this.feedback(m.flash);
            },
            scope:this
          })}
        JS
      }
    end
    
  end
end

Version data entries

12 entries across 12 versions & 4 rubygems

Version Path
skozlov-netzke-basepack-0.1.0.1 lib/netzke/property_grid.rb
skozlov-netzke-basepack-0.1.0 lib/netzke/property_grid.rb
skozlov-netzke-basepack-0.1.1.1 lib/netzke/property_grid.rb
skozlov-netzke-basepack-0.1.1.2 lib/netzke/property_grid.rb
skozlov-netzke-basepack-0.1.1 lib/netzke/property_grid.rb
skozlov-netzke_basepack-0.1.0 lib/netzke/property_grid.rb
skozlov-netzke_core-0.1.0 lib/netzke/property_grid.rb
netzke-basepack-0.1.2.1 lib/netzke/property_grid.rb
netzke-basepack-0.1.4.1 lib/netzke/property_grid.rb
netzke-basepack-0.1.3 lib/netzke/property_grid.rb
netzke-basepack-0.1.2 lib/netzke/property_grid.rb
netzke-basepack-0.1.3.1 lib/netzke/property_grid.rb