Author Topic: Do not show selected options but show default  (Read 5983 times)

rgorantla

  • Pro Deluxe
  • Jr. Member
  • *
  • Posts: 88
    • View Profile
Do not show selected options but show default
« 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?

rgorantla

  • Pro Deluxe
  • Jr. Member
  • *
  • Posts: 88
    • View Profile
Re: Do not show selected options but show default
« Reply #1 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!

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Do not show selected options but show default
« Reply #2 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.

rgorantla

  • Pro Deluxe
  • Jr. Member
  • *
  • Posts: 88
    • View Profile
Re: Do not show selected options but show default
« Reply #3 on: July 07, 2017, 01:00:49 am »
ok, thanks.

Looking forward for the fix

rgorantla

  • Pro Deluxe
  • Jr. Member
  • *
  • Posts: 88
    • View Profile
PQSelect- You shouldn't be able to check more than the max
« Reply #4 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!

rgorantla

  • Pro Deluxe
  • Jr. Member
  • *
  • Posts: 88
    • View Profile
Re: Do not show selected options but show default
« Reply #5 on: August 25, 2017, 05:58:14 pm »
Do you see any issues with the fix that i have?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Do not show selected options but show default
« Reply #6 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.

rgorantla

  • Pro Deluxe
  • Jr. Member
  • *
  • Posts: 88
    • View Profile
Re: Do not show selected options but show default
« Reply #7 on: August 30, 2017, 12:07:57 am »
Great,thank you.. We only have one currently .

rgorantla

  • Pro Deluxe
  • Jr. Member
  • *
  • Posts: 88
    • View Profile
Re: Do not show selected options but show default
« Reply #8 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
« Last Edit: October 12, 2017, 07:59:58 am by rgorantla »