ParamQuery grid support forum
General Category => Bug Report => Topic started 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?
-
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!
-
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.
-
ok, thanks.
Looking forward for the fix
-
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!
-
Do you see any issues with the fix that i have?
-
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.
-
Great,thank you.. We only have one currently .
-
Well, This didn't quite fix the problem
because when we refresh the page - i can still check the boxes :(
fixed it