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 = action.find({id: @item().get('id'), page: 1, page_size: 3})
\r
11 @pager = new Locmare.ListGroupModule.LibModule.PagerModule.More({
\r
12 params: {controller: action.path_name(), action: action.name, id: @item().get('id')}
\r
18 success: (page_status) =>
\r
25 this.$el.html(@filer.el)
\r
29 @filer = new Locmare.Filer({
\r
30 item_name: @has_many_model().item_name(),
\r
31 items: @list.items(),
\r
35 @listenTo(@filer, 'http_get', @http_get)
\r
36 @listenTo(@filer, 'pick', @pick)
\r
41 has_many_model: () ->
\r
42 @has_many_manifest.model()
\r
45 @association.profiler
\r
47 add_pick: (target_model) ->
\r
48 @list.open((page_status) =>
\r
51 @filer.add_pick(target_model)
\r
55 @trigger('http_get', url)
\r
58 @trigger('pick', item)
\r