Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions R/methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ print.bucket_list <- function(x, ...){
# The names must be suffix values to allow for modules which use prefix values
# https://github.com/rstudio/sortable/issues/100
as_rank_list_id <- function(id) {
paste0("rank-list-", id)
# paste0("rank-list-", id)
paste0(id, "-rank-list")
}
# TODO: in future, change the order of paste, to enable shiny modules
# paste0(id, "-rank-list")

as_bucket_list_id <- function(id) {
paste0("bucket-list-", id)
# paste0("bucket-list-", id)
paste0(id, "-bucket-list")
}
# TODO: in future, change the order of paste, to enable shiny modules
# paste0(id, "-bucket-list")
10 changes: 8 additions & 2 deletions R/rank_list.R
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,15 @@ update_rank_list <- function(css_id, text = NULL, labels = NULL,
if ( !is.null(labels) && length(labels) > 0) {
labels <- as.character(tagList(as_label_tags(labels)))
}
message <- dropNulls(list(id = inputId, text = text, labels = labels))
session$sendInputMessage(inputId, message)

# include namespace in message
# to conveniently correct the nested input IDs
# of a rank-list widget inside rank_list_binding.js
message <- dropNulls(list(id = inputId,
text = text,
labels = labels,
namespace = session$ns("")))
session$sendInputMessage(inputId, message)
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $.extend(ranklistBinding, {
}

if (data.labels) {
const short_id = data.id.replace(/^rank-list-/, "");
const short_id = data.namespace + data.id.replace(/-rank-list$/, "");
$('#' + short_id).html(data.labels);
const label_ids = $('#' + short_id).children().map((idx, child) => {
return $(child).attr("data-rank-id") || $.trim(child.innerHTML);
Expand Down