0 Replies Latest reply on May 4, 2010 8:16 AM by EWN-CMI

    Datagrid itemRenderer - Help needed

    EWN-CMI Level 1

      I am having trouble getting this little bit of code working.  I am trying to build an adhoc SQL generator, where the user selects the list of fields and then is able to set the WHERE criteria in a dataGrid, each row has field, criteria (ComboBox -equals, less than, etc), Low (editable), High (editable-Text or ComboBox lookup), AND/OR static ComboBox.  Some of the field selections could be regular text based fields like Name and other fields selected could be lookup fields like State.  I would like to be able to on rows that are TextInput render out a TextInput for LowValue and HighValue columns and for lookup fields render out a ComboBox with the dataProvider being set by a call to addComboData.

       

      addComboData simply uses the myDataGrid.selectedItem.fieldname to determine which of the lookup table to use and assigns that collection to CBoxdataProvider.  Seems simple enough but I have not been able to figure it out, some modifications seem to work, but only for a single dg cell others give me a list but does not populate lowValue but kill all other renderers.  All help is appreciated.

       

       

      <mx:DataGridColumn headerText="Low"  rendererIsEditor="true"  editorDataField="selectedItem" dataField="lowValue" textAlign="center">
      <mx:itemRenderer>
        <mx:Component>
          <mx:HBox horizontalScrollPolicy="off" verticalScrollPolicy="off" horizontalAlign="center">
            
             <mx:ComboBox  initialize="outerDocument.addComboData()" dataProvider="{ outerDocument.CBoxdataProvider }" labelField="Description" textAlign="left"  visible="{data.showCombo}" />
            <mx:TextInput id="lowLabel"  visible="{!data.showCombo}" />

       

         </mx:HBox>
        </mx:Component>
      </mx:itemRenderer>

      </mx:DataGridColumn>