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 on Nov 18 - 1 comments

Eugene commented on Nov 18

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 on Nov 20

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