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, ConfigView, EventView, ImportTypeView, LogView, McflyGridPanel, PostingGrid, ScriptGrid, TagGrid, UserView
Constant Summary
Constants included
from Permissions
Permissions::ALL_ROLES, Permissions::REQ_ROLES
Instance Method Summary
collapse
can_perform_action?, can_perform_actions, current_user_roles, has_any_perm?, has_marty_permissions
Instance Method Details
#class_can?(op) ⇒ Boolean
27
28
29
|
# File 'app/components/marty/grid.rb', line 27
def class_can?(op)
self.class.can_perform_action?(op)
end
|
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# File 'app/components/marty/grid.rb', line 31
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}
end
|
7
8
9
10
11
12
13
14
|
# File 'app/components/marty/grid.rb', line 7
def configure_form_window(c)
super
c.width = 475
end
|
#get_json_sorter(json_col, field) ⇒ Object
49
50
51
52
53
|
# File 'app/components/marty/grid.rb', line 49
def get_json_sorter(json_col, field)
lambda do |r, dir|
r.order("#{json_col} ->> '#{field}' " + dir.to_s)
end
end
|
#has_search_action? ⇒ Boolean
45
46
47
|
# File 'app/components/marty/grid.rb', line 45
def has_search_action?
false
end
|