In my view file I am creating a table like this. Sometimes there are no qualified_dollars and instead of displaying an error I'd like to show "sorry, no data". I found this function in the docs
if($this->dataStore('customer')->isEmpty())
{
echo "No data available!";
}
But I doubt that I can use this in the middle of a create(). How can I just show no data available and escape the error?
Table::create(array(
"dataStore"=>$this->dataStore("BPlt_BC")->filter("taxyear","=",$_SESSION['last_TY']) ->filter("qualified_dollars",">",0),
"showFooter"=>false,
"grouping"=>array(
"item"=>array(
"calculate"=>array(
"{sumAmount}"=>array("sum","dollarsPerBC"),
),
"cssStyle"=>"text-align:right",
"bottom"=>"<td colspan='6 style='text-align: right'><b>Total qualified RESEARCHER wages for : {item}</b></td><td style='text-align: right'><b>{sumAmount}</b></td><br>",
),
),
"showFooter"=>"bottom",
"columns"=>array(
"item"=>array("label"=>"Business Component"),
"employee"),
"cssClass"=>array(
"table"=>"table table-bordered",
"tr"=>"row-css-class",
"th"=>"header-css-class",
"td"=>"cell-css-class",
"tf"=>"footer-cell-css-class",
)
)