Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. selectRows <- function(idx, collapse) {
  2.   JS(
  3.     sprintf("console.log('selectRows: ', this);")
  4.     #sprintf("console.log('idx: ' + %s + ', collapse: ' + typeof %s)", idx, collapse)
  5.     #str_c("var drvindx = [", str_c(idx, collapse = collapse), "];"),
  6.     #"var rowItem = $('td[data-id]', row).filter(function() {
  7.    #   return drvindx.includes(parseInt($(this).attr('data-id')));
  8.    #});
  9.    #"
  10.   )
  11. }
  12.  
  13. addTitleToRowItem <- function(idx, title) {
  14.   JS(
  15.     sprintf("console.log('addTitleToRowItem: ', this)")
  16.     #sprintf("console.log('idx: ' + %s + ', title: ' + '%s')",idx, title)
  17.     #sprintf("var %s = data[%s];", title, idx),
  18.     #sprintf("rowItem.attr('title', %s);", title)
  19.   )
  20. }
  21.  
  22. toggleCSSClassInRowItem <- function(idx, className) {
  23.   JS(
  24.     sprintf("console.log('idx: ' + %s + ', className: ' + %s)", idx, className)
  25.     #sprintf("data[%s] === false ? items.addClass(%s) : items.removeClass(%s);", idx, className, className)
  26.   )
  27. }
  28.  
  29.  
  30.  
  31. selectRows(col_index_visible, ",")
  32. addTitleToRowItem(distance_idx, type_names[i])
  33. toggleCSSClassInRowItem(match_idx, "'note'")  // Only this one is being fired (?)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement