Hi guys, I'm able to use the selected date on the first level of drill down, but cant pass it to the second level...
MyReport.view.php
<div class= "col-md-4 form-group">
<?php
DrillDown::create(array(
"name"=>"saleDrillDown",
"title"=>"Kilometraje recorrido",
"levels"=>array(
array(
"title"=>"ASTRA",
"content"=>function($params,$scope)
{
ColumnChart::create(array(
"dataSource"=>(
$this->src("automaker")->query("
SELECT localidad,
sum(km_real) AS kms
FROM tbl_linde_libroazul_productividad
WHERE YEAR(fecha) = YEAR(:start)
AND MONTH(fecha) = MONTH(:start)
GROUP BY localidad;
")
->params(array(
":start"=>$this->params["startDatePicker"],
))
),
"columns"=>array(
"localidad"=>array(
"type"=>"string",
"label"=>"Localidad",
),
"kms"=>array(
"label"=>"Kms recorrido",
)
),
"clientEvents"=>array(
"itemSelect"=>"function(params){
saleDrillDown.next({localidad:params.selectedRow[0],start:params["startDatePicker"]});
}",
)
));
}
),
array(
"title"=>function($params,$scope)
{
return $params["localidad"];
},
"content"=>function($params,$scope)
{
ColumnChart::create(array(
"dataSource"=>(
$this->src("automaker")->query("
SELECT tractor,
sum(km_real) AS kms
FROM tbl_linde_libroazul_productividad
WHERE YEAR(fecha) = YEAR(:start)
AND MONTH(fecha) = MONTH(:start)
AND localidad = :localidad
GROUP BY tractor
")
->params(array(
":start"=>$this->params["start"],
":localidad"=>$params["localidad"]
))
)
,
"columns"=>array(
"tractor"=>array(
"type"=>"string",
),
"kms"=>array(
"label"=>"Kms recorrido",
)
),
"clientEvents"=>array(
"itemSelect"=>"function(params){
saleDrillDown.next({month:params.selectedRow[0]});
}",
)
));
}
),