0 Replies Latest reply: Jul 22, 2014 5:51 PM by johnbdh RSS

    Cannot get AdvancedDataGridRendererProvider to work

    johnbdh Community Member

      I want to set the first column in an advancedDataGrid to bold when another column in the row is blank. I created a Component mxml renderer to do the trick but I cannot get it to work. I don't think the renderer is even getting called as a break in the renderer is never hit when I run in debug mode.

      My code follows. What am I doing wrong? Any help would be greatly appreciated.

      Thanks,

      John

      Here is my AdvancedDataGrid. The provider is an XMLListCollection...

      <mx:AdvancedDataGrid id="adgFormWithSignatures" visible="{oneStudentSelected}" 
        x="9" y="407" width="625" height="236"
        dataProvider="{formsRequiringSignaures}"
        designViewDataType="tree"
        doubleClick="adgFormWithSignatures_doubleClickHandler(event)"
        doubleClickEnabled="true"
        headerColors="{formsSigsHeaderColors}" headerHeight="50"
        headerWordWrap="true" variableRowHeight="true" wordWrap="true">
        <mx:columns>
             <mx:AdvancedDataGridColumn id="formColumn" width="200"
                  backgroundColor="#EBE9E9" dataField="form" headerText="Form"
                  headerWordWrap="true" sortable="false"/>
             <mx:AdvancedDataGridColumn width="40" dataField="student" headerText="S"
                  sortable="false"/>
             <mx:AdvancedDataGridColumn width="40" dataField="parent" headerText="P"
                  sortable="false"/>
             <mx:AdvancedDataGridColumn width="40" dataField="teacher" headerText="T"
                  sortable="false"/>
             <mx:AdvancedDataGridColumn width="45" dataField="sponsor" headerText="SP"
                  sortable="false"/>
             <mx:AdvancedDataGridColumn width="45" dataField="qualScientSuper"
                  headerText="Sc Su" headerWordWrap="true" sortable="false"/>
             <mx:AdvancedDataGridColumn width="40" dataField="veterinarian" headerText="V"
                  sortable="false"/>
             <mx:AdvancedDataGridColumn width="50" dataField="priorSRCIRB"
                  headerText="P SRC IRC" sortable="false"/>
             <mx:AdvancedDataGridColumn width="50" dataField="resrchInstSRC"
                  headerText="R SRC" sortable="false"/>
             <mx:AdvancedDataGridColumn width="50" dataField="finalSRC" headerText="F SRC"
                  sortable="false"/>
             <mx:AdvancedDataGridColumn width="45" dataField="uploaded" headerText="U"
                  sortable="false"/>
             <mx:AdvancedDataGridColumn visible="false" dataField="formID"
                  headerText="form ID"/>
             <mx:AdvancedDataGridColumn visible="false" dataField="formStudentID"
                  headerText="formStudentID"/>
             <mx:AdvancedDataGridColumn visible="false" dataField="formProjectID"
                  headerText="formProjectID"/>
        </mx:columns>
        <mx:rendererProviders>
             <mx:AdvancedDataGridRendererProvider column="{formColumn}"
             depth="3" renderer="myComponents.SigFormsRenderer"/>
        </mx:rendererProviders>
      </mx:AdvancedDataGrid>
      
      

       

      Here is the SigFormsRenderer.mxml component...


      <?xml version="1.0" encoding="utf-8"?>
      <!-- src/myComponents/SigFormsRenderer.mxml -->
      <mx:Label xmlns:mx="http://www.adobe.com/2006/mxml" textAlign="center">
      
        <mx:Script>
          <![CDATA[
             override public function set data(value:Object):void {
                  if (value["formStudentID"] == "") {
                       setStyle("fontWeight", "bold");
                  } else {
                       setStyle("fontWeight", "normal");
                  }
             }
          ]]>
        </mx:Script>
      
      </mx:Label>