使用换行符分隔 R 闪亮应用程序中的单选按钮
Separating radioButtons in R shiny app with a line break
我的 shiny 应用程序上有一个单选按钮列表,我希望将其分成三组,其中包含 Header、空白 space(如换行符或分段符),甚至一行--------。
我试图通过创建三个单独的按钮 formTypes(formType1、formType2、formType3)来做到这一点,但按钮的功能停止工作。我不太了解 HTML 代码,但我尝试过的代码在 radioButton 代码块中不起作用。你能帮我吗?谢谢。我已经在下面用 **BREAK HERE**
指出了我希望单选按钮分隔的位置
# Create Navigation Bar
navbarPage("Navigation Bar",
# Create a tab for data Entry
tabPanel(
"Data Entry",
sidebarLayout(
sidebarPanel(
radioButtons(
"formType", "Form Type",
c("Basic Info & Universal Flagging" = "basic_info",
"Universal Screening" = "uni_screening",
`**BREAK HERE**`
"BHAP Screening" = "bhap_screening",
"BHAP Intake & Assessment" = "bhap_intakeassessment",
"BHAP Referral" = "bhap_referral", "BHAP Contact Info" = "bhap_contactinfo",
"BHAP Case Management" = "bhap_casemanagement", "BHAP Exit" = "bhap_exit",
`**BREAK HERE**`
"COAP Intake" = "coap_intake", "COAP Assessment" = "coap_assessment",
"Intercept 3: COAP In-Jail Servces" = "coap_injailservices",
"Intercept 4: COAP Support Services Needs" = "coap_supportservices",
"Intercept 4: COAP Reentry/Community-Based Referrals" = "coap_reentrycommunity",
"Provider Updates (In-Jail and Community-Based)" = "coap_providerupdates",
"COAP Contact Info" = "coap_contactinfo", "COAP Case Management" = "coap_casemanagement",
"COAP EXIT" = "coap_exit"))
),
# outputs the dynamic UI component
uiOutput("ui")
)
),
尝试插入 hr(),这是一个 水平规则 。这应该放入带有水平线的 space 。另一种选择是 br(),一个 空白规则 ,做同样的减去行。
您可以添加 javascript/jQuery 以指定特定单选按钮后的中断,在指示时添加 <hr>
:
ui <- fluidPage(
# Create Navigation Bar
navbarPage("Navigation Bar",
# Create a tab for data Entry
tabPanel(
"Data Entry",
sidebarLayout(
sidebarPanel(
radioButtons(
"formType", "Form Type",
c("Basic Info & Universal Flagging" = "basic_info",
"Universal Screening" = "uni_screening",
"BHAP Screening" = "bhap_screening",
"BHAP Intake & Assessment" = "bhap_intakeassessment",
"BHAP Referral" = "bhap_referral", "BHAP Contact Info" = "bhap_contactinfo",
"BHAP Case Management" = "bhap_casemanagement", "BHAP Exit" = "bhap_exit",
"COAP Intake" = "coap_intake", "COAP Assessment" = "coap_assessment",
"Intercept 3: COAP In-Jail Servces" = "coap_injailservices",
"Intercept 4: COAP Support Services Needs" = "coap_supportservices",
"Intercept 4: COAP Reentry/Community-Based Referrals" = "coap_reentrycommunity",
"Provider Updates (In-Jail and Community-Based)" = "coap_providerupdates",
"COAP Contact Info" = "coap_contactinfo", "COAP Case Management" = "coap_casemanagement",
"COAP EXIT" = "coap_exit")),
tags$head(tags$script(HTML("
$(document).ready(function(e) {
$('input[value=\"uni_screening\"]').parent().parent().after('<hr>');
$('input[value=\"bhap_exit\"]').parent().parent().after('<hr>');
})
")))
),
# outputs the dynamic UI component
uiOutput("ui")
)
)
)
)
我的 shiny 应用程序上有一个单选按钮列表,我希望将其分成三组,其中包含 Header、空白 space(如换行符或分段符),甚至一行--------。
我试图通过创建三个单独的按钮 formTypes(formType1、formType2、formType3)来做到这一点,但按钮的功能停止工作。我不太了解 HTML 代码,但我尝试过的代码在 radioButton 代码块中不起作用。你能帮我吗?谢谢。我已经在下面用 **BREAK HERE**
# Create Navigation Bar
navbarPage("Navigation Bar",
# Create a tab for data Entry
tabPanel(
"Data Entry",
sidebarLayout(
sidebarPanel(
radioButtons(
"formType", "Form Type",
c("Basic Info & Universal Flagging" = "basic_info",
"Universal Screening" = "uni_screening",
`**BREAK HERE**`
"BHAP Screening" = "bhap_screening",
"BHAP Intake & Assessment" = "bhap_intakeassessment",
"BHAP Referral" = "bhap_referral", "BHAP Contact Info" = "bhap_contactinfo",
"BHAP Case Management" = "bhap_casemanagement", "BHAP Exit" = "bhap_exit",
`**BREAK HERE**`
"COAP Intake" = "coap_intake", "COAP Assessment" = "coap_assessment",
"Intercept 3: COAP In-Jail Servces" = "coap_injailservices",
"Intercept 4: COAP Support Services Needs" = "coap_supportservices",
"Intercept 4: COAP Reentry/Community-Based Referrals" = "coap_reentrycommunity",
"Provider Updates (In-Jail and Community-Based)" = "coap_providerupdates",
"COAP Contact Info" = "coap_contactinfo", "COAP Case Management" = "coap_casemanagement",
"COAP EXIT" = "coap_exit"))
),
# outputs the dynamic UI component
uiOutput("ui")
)
),
尝试插入 hr(),这是一个 水平规则 。这应该放入带有水平线的 space 。另一种选择是 br(),一个 空白规则 ,做同样的减去行。
您可以添加 javascript/jQuery 以指定特定单选按钮后的中断,在指示时添加 <hr>
:
ui <- fluidPage(
# Create Navigation Bar
navbarPage("Navigation Bar",
# Create a tab for data Entry
tabPanel(
"Data Entry",
sidebarLayout(
sidebarPanel(
radioButtons(
"formType", "Form Type",
c("Basic Info & Universal Flagging" = "basic_info",
"Universal Screening" = "uni_screening",
"BHAP Screening" = "bhap_screening",
"BHAP Intake & Assessment" = "bhap_intakeassessment",
"BHAP Referral" = "bhap_referral", "BHAP Contact Info" = "bhap_contactinfo",
"BHAP Case Management" = "bhap_casemanagement", "BHAP Exit" = "bhap_exit",
"COAP Intake" = "coap_intake", "COAP Assessment" = "coap_assessment",
"Intercept 3: COAP In-Jail Servces" = "coap_injailservices",
"Intercept 4: COAP Support Services Needs" = "coap_supportservices",
"Intercept 4: COAP Reentry/Community-Based Referrals" = "coap_reentrycommunity",
"Provider Updates (In-Jail and Community-Based)" = "coap_providerupdates",
"COAP Contact Info" = "coap_contactinfo", "COAP Case Management" = "coap_casemanagement",
"COAP EXIT" = "coap_exit")),
tags$head(tags$script(HTML("
$(document).ready(function(e) {
$('input[value=\"uni_screening\"]').parent().parent().after('<hr>');
$('input[value=\"bhap_exit\"]').parent().parent().after('<hr>');
})
")))
),
# outputs the dynamic UI component
uiOutput("ui")
)
)
)
)