1 class Locmare.ProfilerModule.AssociationModule.HasMany extends Pettanr.View
\r
4 initialize: (options) ->
\r
5 @association = options.association
\r
6 @has_many_manifest = options.has_many_manifest
\r
8 controller = Manifest.manifest().controllers[@has_many_manifest.controller_name]
\r
9 action = controller.actions[@has_many_manifest.action_name]
\r
10 @list = Locmare.ListGroup.list(
\r
11 action.path_name(), action.name,
\r
12 {id: @item().get('id'), page: 1, page_size: 3}
\r
14 @pager = new Locmare.ListGroupModule.LibModule.PagerModule.More({
\r
15 params: {controller: action.path_name(), action: action.name, id: @item().get('id')}
\r
20 @list.open((page_status) =>
\r
27 this.$el.html(@filer.el)
\r
31 @filer = new Locmare.Filer({
\r
32 item_name: @has_many_model().item_name(),
\r
33 items: @list.items(),
\r
37 @listenTo(@filer, 'http_get', @http_get)
\r
38 @listenTo(@filer, 'pick', @pick)
\r
43 has_many_model: () ->
\r
44 @has_many_manifest.model()
\r
47 @association.profiler
\r
49 add_pick: (target_model) ->
\r
50 @list.open((page_status) =>
\r
53 @filer.add_pick(target_model)
\r
57 @trigger('http_get', url)
\r
60 @trigger('pick', item)
\r