Column Value Date 0000-00-00 to Blank
Column Value Date 0000-00-00 to Blank
vincmeister
Posts: 136Questions: 36Answers: 4
Hello,
How to changes 0000-00-00 from MYSQL to blank in datatables ?
Please advise, thank you
This question has accepted answers - jump to:
This discussion has been closed.
Answers
You can use the API to enable and disable fields:
field().enable()
andfield().disable()
.You might want to use the event listeners for
initEdit
andinitCreate
to decide if you want to call them.Allan
hi allan,
sorry i'm editing my previous question because i already found the answer in the manual by using editor.hide and show.
i think your answer is for my prev question.
Could you just post your new question in future, rather than editing your old one. Now my reply makes no sense for anyone who is searching for the same issue. Thanks.
Regarding your modified question you would use a get formatter.
Allan
Thanks and Sorry Allan.
I already create a get and set formatter, my code :
and I want to change the result, if the date on MySQL 0000-00-00 , datatables will show blank, not 30-11--0001 12:00 AM
my result now is 30-11--0001 12:00 AM
please advise, thank you
You need to use a custom formatter method that will detect the value you want to be blank and return the empty string. The other data would then be formatted as a date, as required.
The documentation for custom formatters is here.
Regards,
Allan
thanks Allan, i'm using something like this, and it works