KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

How to set default values for inputs in CustomBoard #3381

Open Eugene opened this topic on 3 days ago - 1 comments

Eugene commented 3 days ago

Hi,

As I understand in CustomBoard's view I have to use koolreport's inputs. But how to set the default values for them? In usual report I can use Bindable package but it looks it is not supported in CustomBoard.

I also tried to set it directly in view like

 DateRangePicker::create(array(
                           
         'options' => array(
               'startDate' => date('Y-m-d 00:00:00', strtotime('first day of last month')),
                'endDate'=> date('Y-m-d 23:59:59', strtotime('last day of last month'))
                            ),

but it also does not work

Or better forget about any koolreport's features in CustomBoard view and work with it like with usual bootstrap html page

KoolReport commented 1 day ago

You just set the value:

DateRangePicker::create([
    "value"=>[date('Y-m-d 00:00:00', strtotime('first day of last month'),date('Y-m-d 23:59:59', strtotime('last day of last month')]
])

More sophisticatedly, you will do:

"value"=>$this->params()["mypicker"]?$this->params()["mypicker"]:[date('Y-m-d 00:00:00', strtotime('first day of last month'),date('Y-m-d 23:59:59', strtotime('last day of last month')]

in the case you want the daterangepicker to retain value during ajax post back.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

Dashboard