I've created drilldown using Table::create. It works, but when i click the header. it take the selected value of the header and continue the drilldown.
for example.
No | month | value
data [ {'1 ', '1', '1000'}, {'2', '2', '3000'}, {'3', '3', '5000'} ]
so,when i click in the data row. it will drilldown to another table with a correct parametes of month( 1 , 2 or 3 ). but i able to click on the header,and it drilldown to another table with string parameters month. how i disable the header so it can not be click and not redirect to another drilldown.
i can do it with javascript. so when the parameters is string, it wont be drilling down. but it's not a good approach. i rather disabled it.
DrillDown::create(array(
"name"=>"PaymentSalesDrilldown",
"title"=>"Laporan Data Payment Sales Method",
"showHeader"=>true,
"levels"=>array(
array(
"title"=>"Payment Sales",
"content"=>function($params,$scope)
{
Table::create(array(
"dataSource"=>(
$this->src("honda")->query("
SELECT extract(year from tanggal) as jp, count(id) as total_trx, sum(nilai) as nilai, sum(disc) as disc, sum(revenue) as revenue, (SELECT round((sum(revenue::decimal)/(select sum(revenue) from data_sales_spk)*100),2)) as persen
fROM data_sales_spk
GROUP BY jp
ORDER BY jp")
),
"columns"=>array(
"jp"=>array(
"type"=>"string",
"label"=>"Tahun"
),
"total_trx"=>array(
"label"=>"Total Trx"
),
"nilai"=>array(
"type"=>"number",
"label"=>"Nilai Penjualan"
),
"disc"=>array(
"type"=>"number",
"label"=>"Nilai Diskon"
),
"revenue"=>array(
"type"=>"number",
"label"=>"Nilai Revenue"
),
"persen"=>array(
"type"=>"number",
"label"=>"Persen",
"formatValue"=>"@value %",
"decimal"=>2
)
),
"clientEvents"=>array(
"rowClick"=>"function(params){
PaymentSalesDrilldown.next({year:params.rowData[0]});
}",
),
"cssClass"=>array(
"table"=>"table table-hover table-tr"
)
));
}
),