Telerik Forums
KendoReact Forum
1 answer
57 views

Hi, I would like to use a kendo switch inside a form: I' created a little example at:

https://stackblitz.com/edit/react-k3fw3s

 

I need to set the initial value programmatically.

So, I created a function switchSetOn (in the file MyUtils.js) to do this using jquery.

This function works well, because the switch correctly appears as ON, but if I click on it the first click does not work and the control remains ON (after a small movement): from subsequent clicks it works fine.

So, I think that the react control keep is value to false even if I set (via jquery) the aspect to true.

Is there a way to set the value correctly via jquery? (I don't want to use defaultChecked or checked property of the control)

Another problem is that, when I click on the submit button the value of the hidden input "checkbox" of the switch does not fall into the json (I can see only the value of the input "text"). Is there something I have to do to obtain the value?

Thank you

 

Konstantin Dikov
Telerik team
 answered on 02 Jun 2022
0 answers
58 views
I am trying to figure out why the Switch control in my React project goes blank when you turn it to the off position.  It has something to do with it having focus because when I click somewhere else in the application the slider re-appears.
Jimmy
Top achievements
Rank 1
Iron
 asked on 08 Mar 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?