PWA Ribbon: How to get checkbox value RRS feed

  • Question

  • Hello community,

    I am currently working on the ribbon in an application page (SharePoint solution). I added a checkbox inside the ribbon. But now, I need to get the value of this checkbox in my JavaScript code.

    Here's my code:

    Elements.xml (representing the ribbon customization):

    <Controls Id="Dpc2013.Ribbon.ViewGroup.Controls">
      <CheckBox Id="Dpc2013.Ribbon.ViewGroup.HierarchicalView"
        LabelText="Show Detailed View"
        ToolTipTitle="Show Detailed View"
          CommandAction="javascript:GM.ToggleMode(this);" />

    And here's my JS code :

    this.ToggleMode = function (obj) {
    	var mode = obj.checked == true ? 1 : 0;
    	// Send the sorting values to the server by using a callback.
    	var args = Sys.Serialization.JavaScriptSerializer.serialize({
    		Command: commands.GetData,
    		DisplayMode: mode

    The 'mode' variable should be set with the value of the checkbox defined in the ribbon, but how can I get its value??

    Cheers !

    Tuesday, February 5, 2013 4:18 PM