allow ajax data parameter to be specified as a function

... making it easier to integrate search and other features that may need to provide custom data parameters sent as part of the event request