I tried to implement a Ajax table but have encountered error when trying to implement 'date' type variable with fancygrid.
-
When json data return null date to the application (especially after table is refresh when a new record is added)
index: 'pStartDate', title: 'Start Date', type: 'date', format: { read: 'd/m/Y', write: 'd/m/Y', edit: 'd/m/Y' } {"success":"true","data":[{"id":15,"pReport_id":6,"pTypeOfAssessment":null,"pApplicationName":null,"pStartDate":null,"pEndDate":null,"pApplicationURL":null,"pScope":null,"pStatusOfReview":null}],"totalCount":0}
Example: http://jsfiddle.net/t786hyhv/
-
When json data return with data with date, Entering empty date in the field will cause error to occur. This also newly added record by selecting but not adding new date.
{"success":"true","data":[{"id":35,"pReport_id":6,"pTypeOfAssessment":null,"pApplicationName":null,"pStartDate":"14/05/2017","pEndDate":"14/05/2017","pApplicationURL":null,"pScope":null,"pStatusOfReview":null}],"totalCount":1}
Example: http://jsfiddle.net/0noLomqy/
However these does not affect fancygrid that is implemented with local data. E.g. Data: data, instead of
data: {
proxy: {
api: {
create: 'URL',
read: 'URL',
update: 'URL',
destroy: 'URL'
}
}
}
Note: To allow jsfiddle myjson to return, will have to first access the myjson link https cert to prevent cross domain error.