Skip to content

Commit

Permalink
Throw error if magic key isn't defined
Browse files Browse the repository at this point in the history
The DataView will not functioun properly so it must throw an error.
  • Loading branch information
trevordevore committed Sep 20, 2021
1 parent 14785cd commit a12fead
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions dataview_paginated_scroll.livecodescript
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ Returns: nothing
setProp dvDataForPage[pPage] pDataA
local tRow, i

_ValidateMagicKey

put ((pPage-1) * sLocalsA["rows per page"]) into tRow

repeat with i = 1 to the number of elements of pDataA
Expand Down Expand Up @@ -256,3 +258,13 @@ private command _RequestNextPageInQueue

return empty
end _RequestNextPageInQueue


/**
Summary: Throws an error if the "magic key" prop isn't set.
*/
private command _ValidateMagicKey
if the viewProp["magic key"] of me is empty then
throw "DataView Paginated Error: viewProp[" & quote & "magic key" & quote & "] is not defined."
end if
end _ValidateMagicKey

0 comments on commit a12fead

Please sign in to comment.