0 Replies Latest reply on Sep 29, 2007 5:55 AM by kleber.kiefer

    Filter (filterFunction) in more than a xml node

    kleber.kiefer
      Hello guys!!!

      I need yor help with filter (filterFunction) in more than a xml node.
      See the code:

      ==============================================================================
      private function searchFilter(item:Object):Boolean {
      var isMatch:Boolean = false

      var nodes:Array = new Array();
      nodes.push({name:"Name"}); * for this work fine
      nodes.push({name:"GapId"}); * for this work fine
      nodes.push({name:"Team.Name"}); * for this don't work... I believe because have dot (".")
      nodes.push({name:"Informations.Information.Name"}); * for this don't work... I believe because have dot (".")
      nodes.push({name:"Systems.System.Name"}); * for this don't work... I believe because have dot (".")

      for each (var node:Object in nodes) {
      if (item[String(node.name)].toString().toLowerCase().search(search.text.toLowerCase()) != -1) {
      Alert.show(item[String(node.name)].toString());
      isMatch = true
      }
      }
      return isMatch;
      }
      ==============================================================================

      But if I change to (example):

      ==============================================================================
      if (item.Team.Name.toString().toLowerCase().search(search.text.toLowerCase()) != -1) { * it's work fine
      ==============================================================================

      Can you help me????

      Thank a lot!!!

      Kleber