shinyjs, expand a box (not collapse.click)

Hi, I'd like to just shinyjs to collapse a box. I have this shinyjs code in UI;

jscode <- "
shinyjs.collapse = function(boxid) {
$('#' + boxid).closest('.box').find('[data-widget=collapse]').click();
}
shinyjs.collapse1 = function(boxid) {
$('#' + boxid).closest('.box').find('[data-widget=collapse]').click();
}
"

and this in the server section:

  js$collapse("RunsTable")

Which works , except I don't want to toggle the box (i.e., if collapse then expand, if expanded then collapse), which is what .click seems to do (makes sense). I just want to expand (regardless of current state, the box is expanded after the button is clicked). I see a method for expand similar to this, but can't figure out the js code, can someone help?

thanks
Mark

2 Likes

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.