-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScriptsVisuales.R
More file actions
35 lines (33 loc) · 920 Bytes
/
ScriptsVisuales.R
File metadata and controls
35 lines (33 loc) · 920 Bytes
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
# Funciones para cambiar el color a las celdas
changeCellColorRed <- function(i, j){
color <- '#ef7777'
c(
"function(row, data, num, index){",
sprintf("var i = [%s], j = [%s];",
toString(i-1), toString(j), toString('#ef7777')),
" var n = i.length;",
" for(let k=0; k < n; k++){",
" if(index == i[k]){",
" $('td:eq(' + j[k] + ')', row)",
" .css({'background-color': '#ef7777'});",
" }",
" }",
"}"
)
}
changeCellColorGreen <- function(i, j){
color <- '#9ff081'
c(
"function(row, data, num, index){",
sprintf("var i = [%s], j = [%s];",
toString(i-1), toString(j), toString('#9ff081')),
" var n = i.length;",
" for(let k=0; k < n; k++){",
" if(index == i[k]){",
" $('td:eq(' + j[k] + ')', row)",
" .css({'background-color': '#9ff081'});",
" }",
" }",
"}"
)
}