Search This Blog

Tuesday, April 19, 2011

The problem occurs while downloading data from DB into Flex’s DataGrid. If we have a Date column and it’s filled with null values, these values will automatically get the current date (time) value in the process of conversion (when new Date() object is created). To avoid this we can override labelFunction in DataGrid and prevent current_data values from being displayed.

4 comments:

First up I really liked your blog design.Regarding the solution you've posted in the above blog post, I need help with something similar to your logic with a slight modication.In your case, in the labelFunction, you show "" (an empty string). What I need to do is if the value is invalid, I need to retain the already existing value in the cell.

@srvikram13well, if I understood you correctly then you'd need to check the data for the "fault" in the "if (....)" section, correct the data to have them displayed, and return the string.

I know you said you need to " retain the already existing value". There can be problems however, cause flex has some error corrections in the service section (which I haven't touched, so I can't help you with that) and can give you a null value in the grid. There is no sense in messing with labelFunction() at all then because the problem lies deeper - in the data service. If that's the case, try to rewrite the PHP code that downloads data and see what happens. Hope that helps you, Bert.