# Module `DataList`

Component to manage data for huge dataset in scroll.

It requires Druid Scroll and Druid Grid (Static or Dynamic) components

## Functions

init(self, scroll, grid, create_function) | Data list constructor
on_remove(self) | Druid System on_remove function
set_data(self, data) | Set new data set for DataList component
clear(self) | Clear the DataList and refresh visuals
get_first_index(self) | Return first index from data.
get_last_index(self) | Return last index from data
get_length(self) | Return amount of data
get_index(self, data) | Return index for data value
scroll_to_index(self, index) | Instant scroll to element with passed index

## Fields

scroll | The Druid scroll component
grid | The Druid Grid component
top_index | The current visual top data index
last_index | The current visual last data index
scroll_progress | The current progress of scroll posititon
on_scroll_progress_change | Event triggered when scroll progress is changed; event(self, progress_value)

## Functions

init(self, scroll, grid, create_function)
  Data list constructor

  ### Parameters:

  - self DataList
  - scroll druid.scroll The Scroll instance for Data List component
  - grid druid.grid The Grid instance for Data List component
  - create_function function The create function callback(self, data, index, data_list). Function should return (node, [component])
on_remove(self)
  Druid System on_remove function

  ### Parameters:

  - self DataList
set_data(self, data)
  Set new data set for DataList component

  ### Parameters:

  - self DataList
  - data table The new data array

  ### Returns:

  druid.data_list Current DataList instance
clear(self)
  Clear the DataList and refresh visuals

  ### Parameters:

  - self DataList
get_first_index(self)
  Return first index from data. It not always equals to 1

  ### Parameters:

  - self DataList
get_last_index(self)
  Return last index from data

  ### Parameters:

  - self DataList
get_length(self)
  Return amount of data

  ### Parameters:

  - self DataList
get_index(self, data)
  Return index for data value

  ### Parameters:

  - self DataList
  - data table
scroll_to_index(self, index)
  Instant scroll to element with passed index

  ### Parameters:

  - self DataList
  - index number

## Fields

scroll
  The Druid scroll component
  - scroll druid.scroll
grid
  The Druid Grid component
  - grid druid.static_grid
top_index
  The current visual top data index
  - top_index number
last_index
  The current visual last data index
  - last_index number
scroll_progress
  The current progress of scroll posititon
  - scroll_progress number
on_scroll_progress_change
  Event triggered when scroll progress is changed; event(self, progress_value)
  - on_scroll_progress_change druid_event

generated by LDoc 1.4.6 Last updated 2022-02-12 17:16:44