TypeError: Cannot read property 'length' of null for DataTable with headerCheckboxToggleAllPages true #2796
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
I'm submitting a ... (check one with "x")
Current behavior
Before the DataTable's
value
property is initialized, theget allSelected()
function is throwing aTypeError
when theheaderCheckboxToggleAllPages
property is set totrue
.Expected behavior
The
get allSelected()
function should also check to ensure the DataTable'svalue
property is also defined (notnull
) before comparing its length to theselection
length.Minimal reproduction of the problem with instructions
Create a DataTable with paging, multiple select, and the
headerCheckboxToggleAllPages
property is set totrue
. Make sure the DataTable's value doesn't resolve right away.What is the motivation / use case for changing the behavior?
The new
headerCheckboxToggleAllPages
DataTable option is missing a null check.Please tell us about your environment:
Windows
Angular version: 4.x
PrimeNG version: 4.0.1
Browser: All
Language: All
The text was updated successfully, but these errors were encountered: