Envoc / envoc.directives

7 stars 1 forks source link

State Saving #14

Closed rschroeder closed 9 years ago

rschroeder commented 9 years ago

http://www.datatables.net/examples/basic_init/state_save.html

{ staveSave: true .... }

There are also some other options that datatables exposes: stateDuration, stateSaveCallback, statLoadCallback

justinobney commented 9 years ago

@rschroeder - We will need type type of key to identify individual datatables, should this go in the config? or as a name attribute on the oTable directive?

rschroeder commented 9 years ago

It looks like Datatables uses this for the key 'DataTables'+settings.sInstance+''+location.pathname where sInstance is the table id.

justinobney commented 9 years ago

in v1 I intend to store the following:

time  // freshness of data
allSearch: // main search value
currentPage: // current page, need to ensure it is in valid range
linesPerPage: // lines per page

jquery datatables assumes the instance has an id property, we dont have the same assumption, should we base it on the string value of the config ex: "ctrl1.config"

or we could use:

{
  saveState: "key_to_save_by"
}