We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Ribbon ToggleButton

Hi

i have the follow problem.
I have 2 togglebuttons and I want each time I press a button the previous selected to cleared.
The html for the two togglebuttons is bellow simplified JavaScript. By default the 'btbing' button is ON.
Now if the user clicks the 'btosm' button i want the 'btbing' to turned off.
I am using Javasript and jquery.
the JavaScript is as follow but does not work

Thank you in advance for the Help
George


function onBing(e)
{
$('#btosm').attr('toggleState;,false);
}

3 Replies

BS Buvana Sathasivam Syncfusion Team January 24, 2017 07:37 AM UTC

Hi George,   
   
Thank you for using Syncfusion products.   
   
We suspect that the cause of the issue is because you are using attr('toggleState:false’); . You need to use  ej control properties like, ejToggleButton({ "toggleState": false }).  Please check the following code to resolve the issue.   
   
<e-group text="Save" align-type=Rows>   
  <e-content>    
      <e-contents>   
          <e-content-groups>   
   
              // By default btbing first toggle button is ON   
               <e-content-group id=”btbing">   
                  <e-toggle-button-settings default-text="Btbing" active-text="Btbing" toggle-state="ture" click="onBing"/>   
                </e-content-group>   
                 
              // second toggle button   
                <e-content-group id=”btosm">   
                  <e-toggle-button-settings default-text="Btosm" active-text="Btosm" click="onBing"/>   
                </e-content-group>   
   
          </e-content-groups>   
         <e-defaults type="ToggleButton" height="70px" is-big="false"></e-defaults>   
      </e-contents>   
  </e-content>   
</e-group>   
  
   
<script>   
      function onBing(e) {   
           
         // check btosm toggle button   
          if (args.model.activeText == "Btosm") {   
   
           // Call ribbon toggle button Id and find toggle button and set toggle state   
           $("#defaultRibbon_home_Font_btbing").find("input.e-togglebutton").ejToggleButton({ "toggleState": false });   
            }   
        else    
           $("#defaultRibbon_home_Font_btosm").find("input.e-togglebutton").ejToggleButton({ "toggleState": false });   
        }   
</script>   
  
   
Please refer to the below UG documentation link for Toggle Buttons:   
   
Please let us know if you need further clarification.   
   
Regards,   
Buvana S.   



GR George Rossopoulos January 24, 2017 08:49 AM UTC

Hi Buvana

thank you for the prompt reply.
Solved.

George


BS Buvana Sathasivam Syncfusion Team January 25, 2017 05:24 AM UTC

Hi George, 
   
Thanks for your update. Let us know if you have any queries, we are happy to assist you. 
   
Regards,  
Buvana S. 


Loader.
Live Chat Icon For mobile
Up arrow icon