KoolReport's Forum

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

Input with text that explains the options but does not appear when displayed #2547

Open Javier Gallardo opened this topic on on Jan 25, 2022 - 4 comments

Javier Gallardo commented on Jan 25, 2022

Input with text that explains the options but does not appear when displayed example

                         "name" => "issues",
                         "dataStore" => $this->dataStore($arrayProject),
                         "defaultOption"=>array("Select project"=>null),
                         "dataBind" => array(
                             "text" => "project",
                             "value" => "ProjectId",
                         ),
Javier Gallardo commented on Jan 25, 2022

I need some thing like fot DataRange

Example

   DateRangePicker::create(array(
                               
 "name"=>"dateRange",
                                "format"=>"DD/MM/YYYY",
                                    "defaultOption"=>array("Select by date"=>null)
                                //"format"=>"YYYY-MM-DD",
                                "ranges"=>array(
                                    /*
                                    "Hoy"=>DateRangePicker::today(),
                                    "Ayer"=>DateRangePicker::yesterday(),
                                    "Ultimos 7 Dias"=>DateRangePicker::last7days(),
                                    "Ultimos 30 Dias"=>DateRangePicker::last30days(),
                                    "Mes Actual"=>DateRangePicker::thisMonth(),
                                    "Ultimo Mes"=>DateRangePicker::lastMonth(),
                                */
                                    
                                ),
Sebastian Morales commented on Jan 26, 2022

Not sure we understand your question. Which input control (text input, select2, BSelect, ...) are you talking about?

Javier Gallardo commented on Jan 26, 2022

INPUT AND DATARANGE I just need that instead of displaying the values, say select the values and in dataRange I need that instead of displaying the date say, you want to select a date

Sebastian Morales commented on Jan 28, 2022

For text input (TextBox or TextArea widget) you could set attribute "placeholder" like this:

                            TextBox::create(array(
                                "name"=>"textBox",
                                "attributes"=>array(
                                    "class"=>"form-control",
                                    "placeholder"=>"Select project"
                                )
                                ...

As for DateRangePicker (no idea what your DATARANGE meant), we would need to use javascript like this:

    DateRangePicker::create(array(
        "name"=>"myDateRange",
        ...
        "onReady" => "function() { $('#myDateRange span').html('Select a value')' }", // use #myDateRange here as myDateRange is the id/name

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
None yet

None