KoolReport's Forum

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

Input element: MultiSelect AND dropdown incl. autocomplete/select all #78

Open bysystem opened this topic on on Aug 15, 2017 - 22 comments

bysystem commented on Aug 15, 2017

Dear support team,

is it possible to create an input element with MultiSelect AND dropdown incl. autocomplete/select all properties like in the URL below?

http://www.jquery-az.com/boots/demo.php?ex=63.0_9

Kind regards

KoolReport commented on Aug 16, 2017

It is possible. Basically you make sure that when user submit the form, you gather all selections and send to server and insert into the KoolReport.

This wiki may help you to understand how to insert params to KoolReport

Without using the Inputs package, work is little extra when you have to maintain the state of selection by yourself but it is not too hard, just tedious.

FYI, we are working the next version of Inputs package which has the Select2 widget, which able to do what you ask for (dropdown, multiselect, autocomplete), if you interested, I can send you the current version of the package.

bysystem commented on Aug 16, 2017

This is great!

Last week I downloaded the input package from your website. Is that the same version which you can send me? Or does the current version contain a beta of Select2? I'm very very interested for aselect2, so I'm also ready to share / purchase / the costs for it! Please let me know how we / you can proceed faster with deploying of the new input package!

KoolReport commented on Aug 16, 2017

It is ok, we still keep the Inputs free for now. I will send you shortly.

bysystem commented on Aug 16, 2017

OK thx so so much! I'll wait for your post!

KoolReport commented on Aug 16, 2017

I have sent you the package Inputs 1.5.0. The usage of Select2 is pretty much the same with Select.

<?php
Select2::create(array(
    "name"=>"select2",
    "dataStore"=>$this->dataStore('sale_by_month'),
    "dataBind"=>"payment_date",
    "multiple"=>true,
    "attributes"=>array(
        "class"=>"form-control",
    )
));
?>
bysystem commented on Aug 16, 2017

Wooww.. I just embed the Select2 in my code and it's awesome and works like a charme!!!!

Credits are on the way ;-)

This is really great support guys! Thx so much to all!

bysystem commented on Aug 16, 2017

Last question to this topic:

Is it possible to add:

  • a limit to the shown selected options in the field (for example: if the users selects more than 4 options, in the corresponding field appears "X selected" instead of a big list off dutzend selected options).
  • and to add a "select all" button for selecting all the options:

Please see here:

KoolReport commented on Aug 16, 2017

Thank you so much for your generosity :)

For your questions:

  1. I have not fully understood but as I understand now that you want to show number of selections in the Select2. If so you can use echo count($this->params["your_params"])
  2. The [Select All] can be done at client-side

First, Get all the available values. This require abit server-side:

<?php
$option_values = array();
$rows = $this->dataStore("data_store_for_select2")->data();
foreach($rows as $row)
{
    array_push($option_values,$row["option_value"])
}
?>

Second, set value for select2 when button [Select All] is clicked

<script type="text/javascript">
    $('#select_all_button').click(function(){
        $('#'select2_name').val(<?php echo json($option_values); ?>).trigger('change');
    });
</script>
bysystem commented on Aug 17, 2017

Thx a lot for the alternative solution.

I assume my explanation was not clear. I'll try to visualize it:

To point 1: Selected option values: - If the user selects 2 options --> these 2 option values should be shown in the field like:

2 options selected:

2 values are shown in the field:

3 options selected --> It appears "3 selected" in the field instead of the selected option values:

To point 2: Select all button and reset button like:

Is that possible?

KoolReport commented on Aug 17, 2017

I guess I will make widget for the multi-select that you send me in the first post. That's way it will be exact that you need. I think the multiselect that you suggest is a good one. I will keep you update

bysystem commented on Aug 17, 2017

That's great! I'm looking forward for the next version of MultiSelect and wait!

Thx in advance and Kind regards

bysystem commented on Aug 25, 2017

Dear KoolReport team,

any updates for me related to the new widget for MultiSelect which I mentioned above?

KoolReport commented on Aug 26, 2017

I have put your request into the feature list already however we still have a long list above. Forgive us. Would you mind to wait about 2 weeks. Or if you want to use our Consultant Service ($25/hour), I will assign you a developer to create this widget. It will take about 3 hours to complete. However if you use this service, we only charge 1 hour only since we want to put this widget to the inputs package as well. If you agree, you may just put $25 to the tip box ( sorry that we have not had to the payment for service available now). Your widget will be done tomorrow ( the latest is Monday since it is weekend).

bysystem commented on Aug 27, 2017

Thx a lot for your feedback and offer! As it's not urhent isdue I'll esit 2 weeks.

I'm looking forward. Please let me know when it's implemented!

bysystem commented on Aug 27, 2017

After a short internal discussion we need this solution with the new multiselect option described above immediately. Therefore I just have put the 25$ to the tip box for your consultant service mentioned in your previous posting ;-)

Please go ahead and let me know (and send me) if you have impplemented the new MultiSelect version until Monday/Tuesday.

I'm looking forward.

Kind regards, bysystem

KoolReport commented on Aug 28, 2017

Sure! I have assigned developer to do it right away. I will send you in few hours.

KoolReport commented on Aug 28, 2017

Hi,

I've sent you the Inputs package version 2.0.0 to your email. Your request multiselect has the name BSelect. Here is the usage:

<?php
BSelect::create(array(
    "name"=>"bselect",
    "multiple"=>true,
    "dataStore"=>$this->dataStore('customers'),
    "dataBind"=>"customerName",
    "options"=>array(
        "enableFiltering"=>true,
    ),
));
?>

I hope that you are happy with our service and we are looking forward to serving you further.

KoolReport commented on Aug 28, 2017

Have you been able to integrate BSelect into your report? Does it work well? Please let us know.

bysystem commented on Aug 29, 2017

Dear support team,

as I'm not in the office the next a few days (business trip) I'll let you know at least at next monday!

One question: How do I bind the package? use /koolreport/... ???

Kind regards,

KoolReport commented on Aug 29, 2017

Sure thing!

bysystem commented on Aug 30, 2017

Dear support team,

first of all thx a lot for quick implementation. I just have embedded the new multiselect BSelect in my code and I'm excited!

I'm missing only the following 3 functions/properties which I have mentioned (the first of them) in my suggestion above:

  • There is no possiblity to SELECT ALL and DESELECT/RESET ALL (see my post on Aug 17 >> Screenshot to point 2) >> "Alles auswählen" = select all)

  • How can I translate the default string "Search" in the search box field in German?

  • The search seems to be case sensitive >> Means if I search for "klein" --> nothing to find >> But if I search for "Klein" (big capital K) >> I find "Expert Klein". How can I deactivate the case sensitivity so I can find "klein" AND "Klein"?

Kind regards,

KoolReport commented on Aug 31, 2017

Oh, you do said about that but as I replied to your post

"I guess I will make widget for the multi-select that you send me in the first post. That's way it will be exact that you need. I think the multiselect that you suggest is a good one. I will keep you update"

We made the wrapped widget for the multi-select control that you sent me in first post with all its functionality. Not sure if that controls support "deselect all" functionality. I will have a look if it is capable of. Also I will look into the translation of Search and case sensitive issue. I will come back to you.

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