mirror of
https://github.com/fergalmoran/dss.git
synced 2026-01-28 03:35:10 +00:00
22 lines
981 B
CoffeeScript
Executable File
22 lines
981 B
CoffeeScript
Executable File
define ['jquery', 'marionette', 'models/user/userCollection', 'views/user/userItemView', 'text!/tpl/UserListView', 'libs/bootstrap/bootpag'],
|
|
($, Marionette, UserCollection, UserItemView, Template) ->
|
|
class UserListView extends Marionette.CompositeView
|
|
|
|
template: _.template(Template)
|
|
itemView: UserItemView
|
|
itemViewContainer: "tbody"
|
|
initialize: =>
|
|
console.log "UserListView: initialize"
|
|
@collection = new UserCollection()
|
|
@collection.fetch(
|
|
data: @options
|
|
success: =>
|
|
console.log("UserListView: Collection fetched")
|
|
console.log(@collection)
|
|
$("#page-selection").bootpag(total: @collection.page_count).on "page", (event, num) -> # page number here
|
|
$("#content").html "Insert content" # some ajax content loading...
|
|
return
|
|
)
|
|
return
|
|
|
|
UserListView |