onclick

Link R shiny selectInput item to open file actionButton

跟風遠走 提交于 2021-02-19 06:22:48
问题 Using R shiny, is it possible to link selectInput item to open file action button ? I would like to adapt onclick argument of action button to achieve it. Please find below a reproductible example: Supposing we have "file_1.pdf" and "file_2.pdf" on "www" folder, how can I open the file corresponding to select Input choice ? library(shinydashboard) library(shiny) ui <- dashboardPage( dashboardHeader(title = "Open file app"), dashboardSidebar(), dashboardBody( fluidRow( selectInput(inputId =

How to add onclick event to a string rendered by dangerouslysetInnerHtml in reactjs?

岁酱吖の 提交于 2021-02-16 09:47:08
问题 I have a string , i.e, let string= "Hello <b>Click here</b>"; render() { return (<div dangerouslySetInnerHTML={this.createMarkup(value)}/> } createMarkup = value => { return { __html: value }; }; What I would like is to be able to add an onclick event to the <b> tag perform state manipulations on click. The underlying problem is where I had a function which was supposed to render whatever is passed by the API. The API would send a string 'Money received for order ID 123 ', or could be any

R: Switching Between Graphs

不羁的心 提交于 2021-02-15 07:42:54
问题 I am using the R programming language. I am trying to follow the tutorial here on "switching between graphs" : https://plotly.com/r/dropdowns/ (first example). First, I generated some data in R: library(plotly) library(MASS) x <- sample( LETTERS[1:4], 1000, replace=TRUE, prob=c(0.25, 0.25, 0.25, 0.25) ) y <- rnorm(1000,10,10) z <- rnorm(1000,5,5) df <- data.frame(x,y, z) df$x = as.factor(df$x) colnames(df) <- c("x", "y", "z") I tried to modify the code from this tutorial to make the final

Android Button always takes two clicks to fire onClick()

有些话、适合烂在心里 提交于 2021-02-11 15:48:53
问题 I have a RelativeLayout inside of a ScrollView that contains a Button and some TextViews and EditTexts. In my xml layout file, I am defining android:onClick but it always takes two clicks of the button to fire the event. The button always gets the focus on the first click and fires the onClick event on the second click. I have tried setting focusable and focusableInTouchMode both to false but the behavior doesn't change. Here is my layout file: <ScrollView xmlns:android="http://schemas

Android Button always takes two clicks to fire onClick()

青春壹個敷衍的年華 提交于 2021-02-11 15:48:06
问题 I have a RelativeLayout inside of a ScrollView that contains a Button and some TextViews and EditTexts. In my xml layout file, I am defining android:onClick but it always takes two clicks of the button to fire the event. The button always gets the focus on the first click and fires the onClick event on the second click. I have tried setting focusable and focusableInTouchMode both to false but the behavior doesn't change. Here is my layout file: <ScrollView xmlns:android="http://schemas

Android Button always takes two clicks to fire onClick()

隐身守侯 提交于 2021-02-11 15:47:31
问题 I have a RelativeLayout inside of a ScrollView that contains a Button and some TextViews and EditTexts. In my xml layout file, I am defining android:onClick but it always takes two clicks of the button to fire the event. The button always gets the focus on the first click and fires the onClick event on the second click. I have tried setting focusable and focusableInTouchMode both to false but the behavior doesn't change. Here is my layout file: <ScrollView xmlns:android="http://schemas

onclick get this textContent of an element

▼魔方 西西 提交于 2021-02-11 14:26:36
问题 <div class="myclass"> <ul> <li><a> first node <i>textContent</i></a></li> <li><a>textContent1</a></li> <li><a>textContent2</a></li> <li><a>textContent3</a></li> </ul> </div> JS $(".myclass ul li").live("click", function() { alert(this.textContent); }); I wish to get the value of <a> element using onclick and first <li> I wish to get the value of <i> element. Is it possible? 回答1: use text() : $(document).on("click", ".myclass ul li", function() { var txt = $('i', this).length ? $('i', this)

Getting clicked object from each section of a single stack bar as my stack bar has multiple sections Chart.js

∥☆過路亽.° 提交于 2021-02-11 14:12:21
问题 I have developed a single Stacked bar with three section or data source. I want to know which section I have clicked. This is my code .ts file this.chart = new Chart("Chart1", { type: 'bar', data: { datasets: [{ label: 'Data1', data: [27], }, { label: 'Data2', data: [40], }, { label: 'Data3', data: [12], } ], } }); showData(evt:any){ var data = this.chart.getElementsAtEvent(evt) console.log(data[0]._model); // it prints the value of the property } In the data I am not getting data object

Getting clicked object from each section of a single stack bar as my stack bar has multiple sections Chart.js

折月煮酒 提交于 2021-02-11 14:08:39
问题 I have developed a single Stacked bar with three section or data source. I want to know which section I have clicked. This is my code .ts file this.chart = new Chart("Chart1", { type: 'bar', data: { datasets: [{ label: 'Data1', data: [27], }, { label: 'Data2', data: [40], }, { label: 'Data3', data: [12], } ], } }); showData(evt:any){ var data = this.chart.getElementsAtEvent(evt) console.log(data[0]._model); // it prints the value of the property } In the data I am not getting data object

Close div with click outside (parent) [duplicate]

元气小坏坏 提交于 2021-02-11 07:26:48
问题 This question already has answers here : How do I detect a click outside an element? (84 answers) Closed 2 years ago . This is not a new problem on stackoverflow, but I've tried everything without success. I have a "popup" created with two divs. The parent ist the background and the child is the popup content. I want to hide the popup when the user clicks on the background (the parent). It sounds extremly easy also for me but I can't achieve that. This is my code and what I tried (it works