Class: ListTable

ListTable

Control to display a list of items


new ListTable(options)

Constructor

Parameters:
Name Type Description
options Object
Properties
Name Type Argument Default Description
className string
size number <optional>
12

number of items in the list

target Element <optional>
selection boolean <optional>
false

enable list selection

check boolean <optional>
false

enable checkbox on lines

Source:
api/ListTable.js
Fires:
  • event:select
  • event:check
  • event:search
  • event:click
  • event:dblclick
  • change:page
  • draw:item
  • draw:list

Methods


checkAll(b)

Check all lines

Parameters:
Name Type Description
b boolean
Source:
api/ListTable.js
Fires:
  • check:all

clear()

Clear list

Source:
api/ListTable.js

clearSelection()

Clear selection

Source:
api/ListTable.js

drawHead(li)

Draw the current list head

Parameters:
Name Type Description
li Element

the list element where to draw

Source:
api/ListTable.js

drawItem(item, li)

Draw the current list item

Parameters:
Name Type Description
item *
li Element

the list element where to draw the item

Source:
api/ListTable.js

drawList(maps, offset, max)

Show the map list

Parameters:
Name Type Description
maps Array.<Object>
offset number
max number
Source:
api/ListTable.js

filterList()

Filter a set of map

Source:
api/ListTable.js

getChecked()

Get list of checked items

Source:
api/ListTable.js
Returns:
Type
Array.<*>

getSelection()

Get the current selected item

Source:
api/ListTable.js
Returns:
Type
*

hasCheck( [b])

Use checkbox

Parameters:
Name Type Argument Description
b boolean <optional>

if undefined return the current value

Source:
api/ListTable.js
Returns:
Type
boolean

loading( [b])

Add a loading

Parameters:
Name Type Argument Default Description
b boolean <optional>
true
Source:
api/ListTable.js

Search in the list

Parameters:
Name Type Argument Default Description
value string <optional>
''
Source:
api/ListTable.js

setMode( [mode])

Set the list mode

Parameters:
Name Type Argument Default Description
mode string <optional>
list

the mode: list, gallery, mini

Source:
api/ListTable.js

setTarget( [target])

Set taget element

Parameters:
Name Type Argument Description
target Element <optional>

if none remove from current target

Source:
api/ListTable.js

showError(error, clearList)

Display an error

Parameters:
Name Type Description
error string
clearList boolean
Source:
api/ListTable.js

showPage(page)

Function called to request a new page

Parameters:
Name Type Description
page number
Source:
api/ListTable.js