Sha256: b01537c8cf0feaaaedcba3f5c0f7f18a34f990581d49144df3c256c11c83fc11

Contents?: true

Size: 1.18 KB

Versions: 2

Compression:

Stored size: 1.18 KB

Contents

module ProMotion
  # Instance methods
  class TableScreen < Screen
    include MotionTable::PlainTable
    include MotionTable::SearchableTable

    def view
      return self.view_controller.view
    end

    def load_view_controller
      Console.log("- table_data method needed in table view screen.", withColor: Console::RED_COLOR) unless self.respond_to? :table_data
      self.view_controller ||= TableViewController
      self.view_controller.view = self.createTableViewFromData(self.table_data)
      if self.class.get_searchable
        self.makeSearchable(contentController: self.view_controller, searchBar: self.class.get_searchable_params)
      end
    end

    def update_table_data
      self.updateTableViewData(table_data)
    end

    class << self
      def searchable(params={})
        @searchable_params = params
        @searchable = true
      end

      def get_searchable_params
        @searchable_params ||= nil
      end

      def get_searchable
        @searchable ||= false
      end
    end
  end

  class GroupedTableScreen < TableScreen
    include MotionTable::GroupedTable
  end

  class SectionedTableScreen < TableScreen
    include MotionTable::SectionedTable
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ProMotion-0.1.1 lib/ProMotion/classes/TableScreen.rb
ProMotion-0.1.0 lib/ProMotion/classes/TableScreen.rb