PDA

View Full Version : EditorGrid - Float column - Prevent from displaying defaultValue



abhilashca
20 Dec 2011, 12:48 PM
Hello,

I have an EditorGrid in which I'm binding data using XML. One of the (non-editable) column (say Quantity) type is float.

Whenever I try to bind XML data with Quantity node as empty, a default value of 0 (zero) is displayed in the Grid. Please note, I'm not setting the 'defaultValue' property for that particular column.

Is there any way, I can prevent the column from displaying 0 (zero) and to render its as Empty cell itself ? I thought about using 'renderer' method, but no use!

Does anyone has encountered the same issue before? How can I render an empty cell in a float column?

Any help will be appreciated.
Thanks

mitchellsimoens
20 Dec 2011, 12:55 PM
Having the type float means that you will always have a number. I have used type of string and used the convert function on the field so that you can pass anything and the convert it to a value of your choosing.

Or you can override how the float type works.

abhilashca
20 Dec 2011, 1:04 PM
I have used type of string and used the convert function on the field so that you can pass anything and the convert it to a value of your choosing..

Thanks for the reply.

If string type is used, then how did u handled the default sort functionality of the Grid column? Does that means, I need to handle sorting manually?

Thanks :)

abhilashca
20 Dec 2011, 11:11 PM
Yup! That could be solved using config 'useNull'
:)