I have a form with a subreport, I set the default From/To Date range, and also bind the min/max dates to each other. Then on change of a dropdown that calls an subreport update, i lose the To Date value, but not the From Date.
<div class="form-group">
<div class="row">
<div class="col-md-6">
<strong>From Date:</strong>
<?php
DateTimePicker::create(array(
"name"=>"startDatePicker",
"maxDate"=>"@endDatePicker",
"format"=>"MM/DD/YYYY h:mm A",
"themeBase"=>"bs4",
));
?>
</div>
<div class="col-md-6">
<strong>To Date:</strong>
<?php
DateTimePicker::create(array(
"name"=>"endDatePicker",
"minDate"=>"@startDatePicker",
"format"=>"MM/DD/YYYY h:mm A",
"themeBase"=>"bs4",
));
?>
</div>
</div>
</div>
<div class="col-md-6 form-group">
<strong>Trending Group</strong>
<?php
Select::create(array(
"name"=>"trendTypeSelected",
"dataStore"=>$this->dataStore("trendTypes"),
"dataBind"=>"device",
"attributes"=>array(
"class"=>"form-control",
),
"clientEvents"=>array(
"change"=>"function(){
console.log('Testing change 1');
subReport.update('trendselecting',{
/* startDatePicker:$('input[name=\"startDatePicker\"]').val(),
endDatePicker:$('input[name=\"endDatePicker\"]').val(), */
trendTypeSelected:$('#trendTypeSelected').val(),
});
}",
)
));
?>
</div>