Datagrid displaying NULL integers as 0


hello,

 

the data given table displayed in flex datagrid 0 when integer/double has null value.  there way display null without making label function every field (with 49 tables , 15/20 fields per table, tedious exercise)?  real problem faced null values integers/doubles overwritten 0 value once given row edited.  since user still sees same value, none-the-wiser.

 

in separate form editing, use dg.selecteditem.[fieldname] populate each formitem using labelfunctions not best solution.  saving record using current text in each field (converted if necessary).

 

hopefully enough info , in advance!

 

calculoso

hi,

datagrid columns has label function = labelfunction="formatnumber"

formatnumber place can format 0 if it's null.

 

private function formatnumber(item:object, dc:datagridcolumn):string
            {
                if (item==null)){
                    return "0";
                }else{
                    return item[dc.datafield] //here can use formatter number if it.
                }
            }

i hope help.

rgds

 

johnny



More discussions in Flex (Read Only)


adobe

Comments

Popular posts from this blog

Hur installera Joomla på One.com - Joomla! Forum - community, help and support

removing index.php from URL address - Joomla! Forum - community, help and support

「イメージマップのアンカー名には、...」のエラーが出ないようにしたい