Sha256: 76a5d976700ec22bd96fd41fbaf3d5e68da8d26813a2af1c7ff5851d9bd0653a

Contents?: true

Size: 1.02 KB

Versions: 9

Compression:

Stored size: 1.02 KB

Contents

module Netzke
  module Tree
    module Endpoints
      extend ActiveSupport::Concern

      included do
        endpoint :add_window__add_form__submit do |params|
          data = ActiveSupport::JSON.decode(params[:data])
          data["parent_id"] = params["parent_id"]
          client.merge!(component_instance(:add_window).
                      component_instance(:add_form).
                      submit(data, client))
          on_data_changed if client.netzke_set_form_values.present?
          client.delete(:netzke_set_form_values)
        end

        endpoint :update_node_state do |params|
          node = model_adapter.find_record(params[:id])
          if node.respond_to?(:expanded)
            node.expanded = params[:expanded]
            model_adapter.save_record(node)
          end
        end

        endpoint :update_parent_id do |records|
          records.each do |record|
            r = model_adapter.find_record(record[:id])
            update_record(r, record)
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
netzke-basepack-6.5.0.0 lib/netzke/tree/endpoints.rb
netzke-basepack-6.5.0.0.rc2 lib/netzke/tree/endpoints.rb
netzke-basepack-6.5.0.0.rc1 lib/netzke/tree/endpoints.rb
netzke-basepack-1.0.1.0 lib/netzke/tree/endpoints.rb
netzke-basepack-1.0.0.1 lib/netzke/tree/endpoints.rb
netzke-basepack-1.0.0.0 lib/netzke/tree/endpoints.rb
netzke-basepack-1.0.0.0.pre3 lib/netzke/tree/endpoints.rb
netzke-basepack-1.0.0.0.pre2 lib/netzke/tree/endpoints.rb
netzke-basepack-1.0.0.0.pre lib/netzke/tree/endpoints.rb