0 Replies Latest reply on Apr 22, 2010 8:26 AM by dhifallah

    Control TextFormat in datagrid

    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:

       

       

       

      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("#.#.#") )

       

      "color", 0x000000);

       

       

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

       

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

       

      "color", 0x000000);

       

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

      }

      event.preventDefault();

      event.currentTarget.editedItemRenderer.setStyle(

      {

       

      }

       

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

      event.preventDefault();

      event.currentTarget.editedItemRenderer.setStyle(

      {

       

       

       

       

       

       

      please I need help

      var