KoolReport's Forum

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

Checkbox list on a card? #2549

Open Richb201 opened this topic on on Jan 27, 2022 - 13 comments

Richb201 commented on Jan 27, 2022

Is it possible to put a checkbox list on a card? Any examples?

Richb201 commented on Jan 27, 2022

OK. I am skipping the "on a card" requirement. I am trying to create a "progress" control. It will look like this

I don't want the user to be able to check the boxes. I will check the boxes before displaying the control. Here is the code I have:

<div class="col-md-6 form-group">
    <strong>Setup Progress</strong>
    <?php
    CheckBoxList::create(array(
        "name"=>"global_summary",
        "data"=>array(
                "1. employees"=>$this->dataStore("global_summary")->get(0,"num_employees"),
                "2. business components"=>$this->dataStore("global_summary")->get(0,"num_buscomps"),
                "3. projects"=>$this->dataStore("global_summary")->get(0,"num_projects"),
                "4. campaign"=>$this->dataStore("global_summary")->get(0,"num_projects"),
                "5. projects"=>$this->dataStore("global_summary")->get(0,"num_projects"),
                "6. projects"=>$this->dataStore("global_summary")->get(0,"num_projects"),
    ),
        "defaultOption"=>array("None"=>"none"),
    ));
    ?>
</div>

How can I check the boxes programatically and not allow the user to set them?
Richb201 commented on Jan 29, 2022

If it is not possible to create such a control with Koolreport, I'd appreciate an answer. Any other package that you can recommend?

KoolReport commented on Jan 29, 2022

The card was not designed to add the checkboxlist inside. However under the hood, the card is simply card from bootstrap so you can build your own card with checkboxlist inside. I suggest that you can use feature, view source code of browser, navigate to the card, copy it source-code and paste into view file and modify.

Richb201 commented on Jan 30, 2022

Thx. How about this? Can I create a simple card that does not display a value? I still want to use different colors and href and an icon, but no amount? Is it possible?

KoolReport commented on Jan 30, 2022

May I know the class name of card you are using?

Richb201 commented on Jan 30, 2022

I am using this code and it generates the attached. `

<div class="row">
    <div class="col-lg-3">
        <?php
        SimpleCard::create(array(
            "href"=>"cost_center_management",
            "title"=>"1. Company",
            "value"=>$this->dataStore("cost_center")->get(0,"cost_center_count"),
            "baseValue"=>1,
            "preset"=>"danger",
            "cssClass"=>array(
                "icon"=>"fa fa-medkit",
                "card"=>"p-3",
            ),
        ));
        ?>
    </div>
What I'd like to do is to either use the buttons, or use the card, but without a value. I still need to set the warning or danger. Is there some way I could increase the size of the buttons?
Richb201 commented on Jan 30, 2022

Can you tell me the proper syntax for this? I need to set the class to either danger or success based on a value in a datastore.

    <php if ($this->dataStore("cost_center")->>get(0,"num_projects")>0 ;?>
            <button type="button" class="btn btn-success"><i class="fa fa-star"></i>  1. Company</button>
        else
            <button type="button" class="btn btn-danger"><i class="fa fa-star"></i>  1. Company</button>
Richb201 commented on Jan 31, 2022

I have another possibility (probably better). I could use the simple card, like in the above image. But the quantity is overwriting the label. How can I get that quantity to not overwrite the label (ie 1. Company)?

Richb201 commented on Jan 31, 2022

OK, I am getting there with the simple card . See the attached. I'd like the color to be green, yellow, or red depending on the value in the datastore. I'd also like the value to not overwrite the title. Can you tell me how to change these two things?

Richb201 commented on Feb 2, 2022

This is SimpleCard.

I also want to add a progress bar to the bottom of this tab. I plan to include the code:

<div class="progress mb-3">
        <div class="progress-bar progress-bar-striped" role="progressbar" style="width: 10%" aria-valuenow="10" aria-valuemin="0" aria-valuemax="100"></div>
    </div>

I am assuming that I need to update aria-valuenow? How to do this? Something like this?

$val=20;
<div class="progress mb-3">
        <div class="progress-bar progress-bar-striped" role="progressbar" style="width: 10%" aria-valuenow=<?php echo str($val)?> aria-valuemin="0" aria-valuemax="100"></div>
    </div>
Richb201 commented on Feb 3, 2022

Is there any support there?

KoolReport commented on Feb 7, 2022

I am really sorry for the late reply, we were in the lunar new year. For your question regarding progress bar. The value that you need updated is the width in the style. Give it a percentage value, it will change the length in the progress bar

Richb201 commented on Feb 7, 2022

Thanks. How about the placement of the number right over the label for the simple card? How about the color of the simple card?

Rich

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

Inputs