ParamQuery grid support forum

General Category => Bug Report => Topic started by: rgorantla on July 05, 2017, 11:49:43 pm

Title: Do not show selected options but show default
Post by: rgorantla on July 05, 2017, 11:49:43 pm
Hi,

I am using pqselect to shos/hide columns. But we do not want to see the column names again(please see optionsselected image). Instead show a "text" everytime

Another Question :

I set maxselect as 2 , sleected options do not show more than 2 but i can still check  the other options. If the maxselected is reached- we shouldn't be able to check too.
Any workaround for that?
Title: Re: Do not show selected options but show default
Post by: rgorantla on July 06, 2017, 07:52:47 am
I was able to get my 1st question work by using the following in pqselect :maxDisplay: 0,
                display Text: "Select/Unselect Columns" .

But if you can give me a work around for 2nd question - that would be great.

thanks!
Title: Re: Do not show selected options but show default
Post by: paramvir on July 06, 2017, 06:24:21 pm
2nd point seems to be an issue, couldn't find any workaround. I'm moving it bug log.

would let you know once the fix is available.
Title: Re: Do not show selected options but show default
Post by: rgorantla on July 07, 2017, 01:00:49 am
ok, thanks.

Looking forward for the fix
Title: PQSelect- You shouldn't be able to check more than the max
Post by: rgorantla on August 25, 2017, 01:38:42 am
Hi,

I think i found a solution to this problem. Solution : when you reach the maximum selection s- i am disabling all other options which are not selected,and when you uncheck an option - they will get enabled again

Below is my code. If you think this causes any issue - please let me know.

  $sel.pqSelect({
                checkbox: true,
                multiplePlaceholder: 'Select/Unselect columns',
                maxDisplay: 100,
                width: 'auto',
                maxSelect: 20, maxDisplay: 0,
                displayText: "Select/Unselect Columns",
                //deselect: false,
                search: true,
            }).on("pqselectmaxselectreach", function (event, ui) {
                $("label[id^=pq-option]").find('input:not(:checked)').attr('disabled', 'disabled');
            })
                .on("change", function (event) {
                    var length = 20;
                    if ($(this).find("option:selected").length < length) {
                        $("label[id^=pq-option]").find('input[type="checkbox"]').removeAttr('disabled');
                    }
                });

Thanks!
Title: Re: Do not show selected options but show default
Post by: rgorantla on August 25, 2017, 05:58:14 pm
Do you see any issues with the fix that i have?
Title: Re: Do not show selected options but show default
Post by: paramvir on August 28, 2017, 01:22:55 pm
It's fine as long as there is only one pq select list on the page. If there are multiple pq select lists, then it would affect other pqselect lists.
Title: Re: Do not show selected options but show default
Post by: rgorantla on August 30, 2017, 12:07:57 am
Great,thank you.. We only have one currently .
Title: Re: Do not show selected options but show default
Post by: rgorantla on October 12, 2017, 07:53:21 am
Well, This didn't quite fix the problem
because when we refresh the page - i can still check the boxes :(


fixed it