-
Notifications
You must be signed in to change notification settings - Fork 0
/
ProcessRockFinder.js
40 lines (33 loc) · 1.2 KB
/
ProcessRockFinder.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
$(document).ready(function() {
hljs.initHighlightingOnLoad();
// submit form on ctrl+enter
$('#wrap_Inputfield_code').keydown(function (e) {
if ((e.ctrlKey || e.altKey) && e.keyCode == 13) {
$('#submit').click();
}
});
});
document.addEventListener('RockGridItemBeforeInit', function(e) {
if(e.target.id != 'RockGridItem_ProcessRockFinderResult') return;
var grid = RockGrid.getGrid(e.target.id);
// overwrite rowactions for first column
col = grid.getColDef('id');
col.cellRenderer = function(params) {
var grid = RockGrid.getGrid(params);
// extend the current renderer and add custom icons
return '<span>' + params.data.id + '</span>' + RockGrid.renderers.actionItems(params, [{
icon: 'fa fa-search',
href: ProcessWire.config.urls.admin + 'page/edit/?id=' + params.data.id,
str: 'show',
class: 'class="pw-panel"',
target: 'target="_blank"',
}]);
}
});
document.addEventListener('RockGridButtons.beforeRender', function(e) {
if(e.target.id != 'RockGridWrapper_ProcessRockFinderResult') return;
var grid = RockGrid.getGrid(e.target);
var plugin = grid.plugins.buttons;
// remove a btton
plugin.buttons.remove('refresh');
});