0 Replies Latest reply on Apr 21, 2010 9:03 AM by dhifallah

    TextFormat doen't work

    dhifallah

      i'm new in this forum and i hope finding my ansaw to my problem.

      I have an editable datagrid in wich the user have to enter numbers in this form : #.#.#

      I tried with my code but it doen't work and show me an error:

       

      var

       

       

      txtIn:TextInput = TextInput(event.currentTarget.itemEditorInstance);

       

      var curValue:Number = Number(txtIn.text);

       

       

      if(event.dataField == "tag_version" || (event.dataField =="version_cible"))

      {

       

      if(!isNaN(curValue) || TextFormat("#.#.#") )

      event.preventDefault();

      event.currentTarget.editedItemRenderer.setStyle(

      "color", 0x000000);

      Alert.show(

      'Merci d\'enter des chiffres en respectant le format de chaque colonne', 'Erreur');

      }

       

      else if(event.dataField =="lot_cible")

      {

       

      if(!isNaN(curValue) || TextFormat("#.#"))

      event.preventDefault();

      event.currentTarget.editedItemRenderer.setStyle(

      "color", 0x000000);

      Alert.show(

      'Merci d\'enter des chiffres en respectant le format de chaque colonne', 'Erreur');

      }

       

       

      please I need help