Skip to content

Commit

Permalink
export slickgrid functions
Browse files Browse the repository at this point in the history
  • Loading branch information
erikriverson committed Sep 18, 2012
1 parent c77f749 commit 85bd7ed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions NAMESPACE
Expand Up @@ -22,6 +22,11 @@ export(muInsertRow)
export(muPrintIdentity)
export(muPrintIdentityHTML)
export(muRownames)
export(muSlickGridDocFooter)
export(muSlickGridDocHeader)
export(muSlickGridFooter)
export(muSlickGridHeader)
export(muSlickGridMarkupGenerator)
export(muStratSummary)
export(muStratTest)
export(mutable)
Expand Down
5 changes: 5 additions & 0 deletions R/slickgrid.R
@@ -1,9 +1,11 @@

#' @export
muSlickGridMarkupGenerator <- function(x, file) {
cat(c('var data = ',
toJSON(x) , ";\n"), file = file, append = TRUE)
}

#' @export
muSlickGridHeader <- function(x, caption, footnote) {
c('<div id="myGrid" style="width:700px;height:500px;"></div>',
'<script>',
Expand All @@ -25,15 +27,18 @@ muSlickGridHeader <- function(x, caption, footnote) {
'')
}

#' @export
muSlickGridFooter <- function(x) {
c('$(function () {',
'grid = new Slick.Grid("#myGrid", data, columns, options);',
'})',
'</script>')
}

#' @export
muSlickGridDocFooter <- muHTMLDocFooter

#' @export
muSlickGridDocHeader <- function(cssFile) {
c('<!DOCTYPE HTML>',
'<html>',
Expand Down

0 comments on commit 85bd7ed

Please sign in to comment.