1 Reply Latest reply on Sep 4, 2009 9:30 AM by GeorgeWS

    Filtering

    GeorgeWS Level 1

      I am stumped. I have data filling a datagrid with an arraycollection, there is a slider and 3 comboboxs. everything works perfectly except my BRAND combobox. my filter looks like this:

       

       

       

       

       

       

       

       

       

       

       

       

      public

       

       

      function

      sliderFilterFunc(item:Object):Boolean {

       

       

      var

      minSlider:uint = slider.values[0];

       

       

      var result:Boolean=false

      ;

       

       

      if

      ((item.myValue == minSlider) &&

      (brandfilter.selectedItem.label ==

       

      "Select a Brand"

      || item.COMC03 == brandfilter.selectedItem.data) &&

      (aRegion.selectedItem.data ==

       

      "1"

      || item.REGN03 == aRegion.selectedItem.data) &&

      (premisefilter.selectedItem.data ==

       

      "1"

      || item.ONOF03 == premisefilter.selectedItem.data)

      )

      {

      result=

       

      true

      ;

      }

       

       

      return

      result;

       

      The COMC03 is in the data, When I select a brand from the brand filter all the data disapears, If I set it back to "Select a Brand" all the data show. I have gone as far as putting an Alert to show me that the data is getting to the "brandfilter.selectedItem.data" spot in the filter also if I put a number in that spot and then change the filter to anything the filter filters to the brand so that part is working. I am stumped I have dozens of filters working in other applications. Im so stuck, There are no blanks or nulls in the data. The data for the datagrid and combobox come from the same database.

      My filters are like this:

       

       

       

       

       

       

       

       

       

       

       

      <mx:HSlider

       

       

      id="slider" width="200" thumbCount="1" snapInterval="1" tickInterval="1

      "

      values="

       

      {getCurrentMonth()}" labels="['Jan', 'Dec']" minimum="1

      "

      maximum="

       

      12" dataTipFormatFunction="getSliderLabel" themeColor="#73B9B9" liveDragging="true

      "

      change="slider_change(event);"

       

      />

       

       

      <mx:ComboBox id="brandfilter" dataProvider="{newBrands}" close="selectedItem=ComboBox(event.target).selectedItem" width="140

      "

      change="myData.refresh()" themeColor="

       

      #73B9B9"

      />

       

       

      <mx:ComboBox id="aRegion" dataProvider="{theRegion}" width="75

      "

      close="selectedItem=ComboBox(event.target).selectedItem"

      change="myData.refresh()" themeColor="

       

      #73B9B9"

      />

       

       

      <mx:ComboBox id="premisefilter" dataProvider="{newPremise}

      "

      width="

       

      90

      "

      close="selectedItem=ComboBox(event.target).selectedItem"

      change="myData.refresh()" themeColor="

       

      #73B9B9"

      />

       

       

      like I said everything works great except the brandfilter combo. any thoughts?

       

      Thanks

       

      George

        • 1. Re: Filtering
          GeorgeWS Level 1

          Got it. When using the RO that calls data from my cfc. I have the function build a temp table to be used in a query of query. My resluting table has all the fields marked as VarChar. I changed the one that drived the brand number to Integer and It now works. What a pain, but worth it now that it works!