Class: Marty::Grid
- Inherits:
-
Netzke::Grid::Base
- Object
- Netzke::Grid::Base
- Marty::Grid
show all
- Extended by:
- Permissions
- Defined in:
- app/components/marty/grid.rb
Direct Known Subclasses
ApiConfigView, ApiLogView, BackgroundJob::DelayedJobsGrid, BackgroundJob::ScheduleJobsGrid, BackgroundJob::ScheduleJobsLogs, ConfigView, ImportTypeView, LogView, McflyGridPanel, Notifications::ConfigView, Notifications::DeliveriesView, Notifications::GridView, Postings::Grid, Postings::SummaryGrid, ScriptGrid, TagGrid, Users::UserView
Constant Summary
Constants included
from Permissions
Permissions::NETZKE_ENDPOINTS
Instance Method Summary
collapse
can_call_endpoint?, can_perform_action?, can_perform_actions, current_user_roles, extended, has_any_perm?, has_marty_permissions, has_perm?
Constructor Details
#initialize(args, kwargs = nil) ⇒ Grid
parent grid is the grid in which child/linked_components is defined child components are components dependent on the selected parent row linked components will update whenever the parent is updated
9
10
11
12
13
|
# File 'app/components/marty/grid.rb', line 9
def initialize args, kwargs = nil
super(args, kwargs)
client_config[:child_components] = child_components || []
client_config[:linked_components] = linked_components || []
end
|
Instance Method Details
#child_components ⇒ Object
103
104
105
|
# File 'app/components/marty/grid.rb', line 103
def child_components
[]
end
|
#class_can?(op) ⇒ Boolean
21
22
23
|
# File 'app/components/marty/grid.rb', line 21
def class_can?(op)
self.class.can_perform_action?(op)
end
|
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'app/components/marty/grid.rb', line 25
def configure(c)
super
c.permissions = {
create: class_can?(:create),
read: class_can?(:read),
update: class_can?(:update),
delete: class_can?(:delete)
}
c.editing = :both
c.store_config = { page_size: 30 }
c.view_config = { preserve_scroll_on_reload: true }
c.buffered_renderer = false
end
|
111
112
113
114
115
116
117
118
119
120
121
|
# File 'app/components/marty/grid.rb', line 111
def configure_form_window(c)
super
c.klass = Marty::RecordFormWindow
c.width = 475
end
|
#get_json_sorter(json_col, field) ⇒ Object
53
54
55
56
57
|
# File 'app/components/marty/grid.rb', line 53
def get_json_sorter(json_col, field)
lambda do |r, dir|
r.order(Arel.sql("#{json_col} ->> '#{field}' " + dir.to_s))
end
end
|
#has_search_action? ⇒ Boolean
43
44
45
|
# File 'app/components/marty/grid.rb', line 43
def has_search_action?
false
end
|
#linked_components ⇒ Object
107
108
109
|
# File 'app/components/marty/grid.rb', line 107
def linked_components
[]
end
|