1 Reply Latest reply on Jan 28, 2010 10:44 PM by Francisc

    labelFunction for cell datagrid validation

    miguel8312 Level 3
        private function price(item:Object, column:DataGridColumn):String {
                   if (item.col1.length !=9) { return item.col1 + "error" };
                   if (item.col2.length > 15){ return item.col2 + "error"};
                   if (item.col2.length > 10){ return item.col3 ,setStyle("color", 0xff0000) + "error" };
                     }
      


      can someone please help me out with this function im trying to validate the items on a datagrid for lenght of theirs string but when i try to do it this way i get really bad errors.

       

        <mx:DataGridColumn headerText="Vendor Number" dataField="col1" itemRenderer="PriceLabel" />
          <mx:DataGridColumn headerText="Invoice Number" dataField="col2" itemRenderer="PriceLabel"/>
          <mx:DataGridColumn headerText="Invoice Date" dataField="col3" />

      i like to validate each column separetely but its seems to try to do it all at once.

      Any help would be greatly appreciated.

      Thanks

      you