Skip to content

Commit

Permalink
closes yihui/shiny#4 after cleaning it up a bit
Browse files Browse the repository at this point in the history
use [searchField] instead of $.makeArray(), and unlist() it on the R side
  • Loading branch information
yihui committed Aug 22, 2014
1 parent 82fb11a commit 063ac98
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion R/update-input.R
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ updateSelectizeInput <- function(session, inputId, label = NULL, choices = NULL,
selectizeJSON <- function(data, req) {
query <- parseQueryString(req$QUERY_STRING)
# extract the query variables, conjunction (and/or), search string, maximum options
var <- fromJSON(query$field)
var <- unlist(fromJSON(query$field, asText = TRUE))
cjn <- if (query$conju == 'and') all else any
# all keywords in lower-case, for case-insensitive matching
key <- unique(strsplit(tolower(query$query), '\\s+')[[1]])
Expand Down
8 changes: 4 additions & 4 deletions inst/www/shared/shiny.js
Original file line number Diff line number Diff line change
Expand Up @@ -2246,14 +2246,14 @@
selectize.clearOptions();
selectize.settings.load = function(query, callback) {
if (!query.length) return callback();
var settings = selectize.settings;
$.ajax({
url: data.url,
data: {
query: query,
field: JSON.stringify($.makeArray(
selectize.settings.searchField)),
conju: selectize.settings.searchConjunction,
maxop: selectize.settings.maxOptions
field: JSON.stringify([settings.searchField]),
conju: settings.searchConjunction,
maxop: settings.maxOptions
},
type: 'GET',
error: function() {
Expand Down

0 comments on commit 063ac98

Please sign in to comment.