Bug 37492 - We should set datatable defaults for possible null returns
Summary: We should set datatable defaults for possible null returns
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords: Academy
Depends on: 36196
Blocks:
  Show dependency treegraph
 
Reported: 2024-07-26 13:17 UTC by Martin Renvoize (ashimema)
Modified: 2024-07-26 19:31 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize (ashimema) 2024-07-26 13:17:57 UTC
As discussed on bug 36169 we're side stepping null values instead of using a proper default handler as suggested by Victor in comment 4 and comment 5.

We should use the defaultContent handler instead.
Comment 1 Victor Grousset/tuxayo 2024-07-26 19:31:34 UTC
(In reply to Victor Grousset/tuxayo from bug 36169 comment #4)
> This seem to be the proper way to handle null values:
> https://stackoverflow.com/questions/48917064/how-do-you-properly-handle-null-
> values-in-datatables/48920248#48920248
> Hopefully that works in our case.
> 
> From reading quickly:
> Adding «"defaultContent": ""»
> And maybe having to change our "targets" value if for some reason it only
> work with '_all' (and that we somehow can get away without [0,1,2,3,4])


(In reply to Victor Grousset/tuxayo from bug 36169 comment #5)
> Another source:
> https://stackoverflow.com/questions/57711349/how-to-deal-with-null-values-in-
> jquery-datatable-when-using-ajax/57714479#57714479
> 
> ---
> 
> And another.
> According to the usage of defaultContent there, we can even target
> individual columns for default values:
> https://datatables.net/forums/discussion/50823/handling-null-values
> 
> So it seems pretty sure we can use that.