0 Replies Latest reply on Jun 8, 2007 10:33 AM by SUNITAR

    Fitering datagrid

    SUNITAR
      Hi,

      I have this datagrid which has 6 columns . Out of these 6 columns 2 columns ar editable. Like user can enter data in there
      and wehn clicks the submit button the data gets inserted to a sql server table. Recently I implemented a filter function on one of the columns called category . I have a combo box called category from which the user can select and see the filtered data. The filter function working properly. It filters the data in the datagrid. But what happens when the user inserts or updates data in those 2 editable columns. The application brings the changed rows to the down of the grid. Like any change made to the row brings the row to the bottom of the grid. Why is this happening ? How can I fix this ? Please help. The code for the filter like this:

      private function processdatagridFilter(item:Object):Boolean {
      var result:Boolean=false;

      if (CategoryCB.selectedItem.data == "1" || (item.cat != null && item.cat.toUpperCase().indexOf(CategoryCB.selectedLabel.toUpperCase()) >= 0))
      {
      result=true;
      }

      return result;
      }


      myData.filterFunction=processdatagridFilter;

      myData the array is the dataprovider for the grid. Combobox : <mx:ComboBox id="CategoryCB" dataProvider="{Category}" labelField="label"
      change="myData.refresh();" width="150" x="75" y="54"/>
      Please help. Thanks in advance. I am a newbee..