Displaying Integer values of zero as empty string

QuestionsDisplaying Integer values of zero as empty string
Gary Wilson asked 4 months ago

Hi,

Some DB rows have salary data but some do not. The column is of type int. When it is set to null in the database, the value is displayed as 0.00 in the grid. How can I show as an empty string?

Secondly, I am calculating footer row summaries for average values. if some values are displayed as 0.0, this drags down the average. I guess I need some custom JS code to calculate this value which discards the 0.0 values?

thanks

Gary

2 Answers
Abu answered 3 months ago

It will need custom formatter and number formatter does not support it.

Refer this demo code:
https://gist.github.com/gridphp/2e1628aeb7a2ca744076e4867e85a73f

Line 31-32 and 56-78

Abu answered 3 months ago

About footer summary, yes custom code will be required to skip blank.

You can refer this code sample:
https://www.gridphp.com/demo/demos/appearance/footer-row.phps 236-247

Let me know if you have any query,

Your Answer

8 + 10 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?