pc弹窗宽度_从ShinyBS增加弹出弹出窗口的宽度

I've created a pop-up with the popify function from the shinyBS package in Shiny. I want to have a pop-up on the bottom of my filter that is as wide as my filter itself. I can't find anything in the documentation about this.

screenshot:

Example code:

library(shiny)

library(shinyBS)

shinyApp(

ui =

fluidPage(

sidebarLayout(

sidebarPanel(

tags$span(

popify(

sliderInput("bins",

"Number of bins:",

min = 1,

max = 50,

value = 30),

'a very long popup',"1. I want everything behind 1 on one line and everything that starts after
2. I want to see on the second line without wrapping it to the 3rd line.")),

actionButton("tabBut", "View Table")

),

mainPanel(

plotOutput("distPlot"),

bsModal("modalExample", "Data Table", "tabBut", size = "large",

dataTableOutput("distTable"))

)

)

),

server =

function(input, output, session) {

output$distPlot

x

bins

# draw the histogram with the specified number of bins

hist(x, breaks = bins, col = 'darkgray', border = 'white')

})

output$distTable

x

bins

# draw the histogram with the specified number of bins

tab

tab$breaks

paste0(signif(tab$breaks[i], 3), "-", signif(tab$breaks[i+1], 3))

})

tab

colnames(tab)

return(tab[, 1:3])

}, options = list(pageLength=10))

}

)

解决方案

You could try adding some CSS to do this.

In your sidebar panel you could add:

tags$style(".popover{

max-width: 100%;

}")

If this is not big enough, you can add options=list(container="body") in your popify to make body the holder which allows for the popup to be as large as the page.

There is more info here, I adapted that answer to R.

在LayUI中,可以通过父窗口弹出层传递数据来实现弹出层中的编辑操作。具体步骤如下: 1. 在父窗口中,点击编辑按钮时,将当前选中行的数据传递给弹出层。 2. 弹出层通过获取到父窗口传递的数据,在弹出层中展示出来。 在代码中,可以使用以下方法来实现弹窗间的传值: 1. 首先,通过`window\[layero.find('iframe')\[0\]\['name'\]\]`获取到弹出层中的iframe页的窗口对象。 2. 然后,可以使用`iframeWin.method()`来执行iframe页中的方法。 3. 可以使用`layer.getChildFrame('body', index)`来获取到iframe页的body内容。 4. 最后,可以使用`body.find('input').val('Hi,我是从父页来的')`来设置弹出层中的input元素的值。 以下是一个示例代码: ```javascript layer.open({ type: 2, content: 'test/iframe.html', success: function(layero, index){ var body = layer.getChildFrame('body', index); var iframeWin = window\[layero.find('iframe')\[0\]\['name'\]\]; iframeWin.method(); // 执行iframe页的方法 console.log(body.html()); // 获取iframe页的body内容 body.find('input').val('Hi,我是从父页来的'); // 设置弹出层中的input元素的值 } }); ``` 通过以上方法,可以实现LayUI弹窗间的传值。 #### 引用[.reference_title] - *1* *3* [layui弹窗间的传值(layui弹出层传值)(窗口传值)](https://blog.csdn.net/m0_46991388/article/details/116647023)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [layui弹窗窗口之间怎样传参数](https://blog.csdn.net/weixin_42519514/article/details/112944221)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值