Can't Check or UnCheck "Allow Filtering"

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
9 Jahre weitere
After you have added a specification attribute to a product and want to then "Update" that attribute, you cannot check or uncheck the "Allow Filtering" checkbox. I think this should be available.
9 Jahre weitere
Hi Blake,

It's not the bug. It was done when "Attribute type" field was added. "Allow filtering" is hidden when "Attribute type" is not set to "Option" (whn adding a new specification attribute). If it's editable, then a store owner can accidentally enable it for "Attribute type" other than "Option". It can cause issues. The solution could be to enable/disable editing of this column based on "Attribute type" but not sure that KendoUI supports it.

Anyway, please find this work item here
9 Jahre weitere
For editing, to get this working quickly, I didn't bother with any notification of warning in the kendo grid...and just did it similar to your add function.  For others who come across this thread and have the source version for 3.5, you can do the following;

Find this section in the admin productcontroller (its part of the ProductSpecAttrUpdate actionresult)

//we do not allow editing these fields anymore (when we have distinct attribute types)
//psa.CustomValue = model.CustomValue;
//psa.AllowFiltering = model.AllowFiltering;
psa.ShowOnProductPage = model.ShowOnProductPage;
psa.DisplayOrder = model.DisplayOrder;

//CustomCode
if (psa.AttributeType == SpecificationAttributeType.Option)
    psa.AllowFiltering = model.AllowFiltering;
else
    psa.AllowFiltering = false;


_specificationAttributeService.UpdateProductSpecificationAttribute(psa);

then on the razor page (_CreateOrUpdate.SpecificationAttributes.cshtml), simply change from
AllowFiltering: { editable: false, type: "boolean" },
to
AllowFiltering: { editable: true, type: "boolean" },

The user experience is as follows;
If your on your specification attributes tab, and you go to edit a specification, clicking edit will unlock the allow filtering checkbox...to allow you to either check or uncheck.  If when you enable allow filter checkbox, and the specification is not an option type, the code above will ignore your model value and force it to false when you click the update button. If its type is Option, then it will write whatever is in the model (true or false).  

The downside is there really isn't a notification to explain to a user why allow filtering works for some types, but not others. So its just a very minor training issue.  As Andrei mentioned, some additional notification in the grid would be better, but at least this guarantees no errors get introduced.

Thanks
Chuck
8 Jahre weitere
ChuckR wrote:
//CustomCode
if (psa.AttributeType == SpecificationAttributeType.Option)
    psa.AllowFiltering = model.AllowFiltering;
else
    psa.AllowFiltering = false;


Thanks for that post Chuck, was just looking at this when I found your post.  I turned the if/else into a ternary operator to keep it a one liner but functionally it's the same:
psa.AllowFiltering = (psa.AttributeType == SpecificationAttributeType.Option) ? model.AllowFiltering : false;
Would be nice if this one could make it back into the core to restore this functionality that was lost in 3.5.  I realise it would be more user friendly if the kendo grid enabled/disabled it in the gui but I think the pros outweigh the cons.
8 Jahre weitere
Would also be handy if the input field for the custom html type was changed from a single line textbox:

http://imagizer.imageshack.us/a/img537/8863/wZkekx.png

I've changed it to a multiline textbox for now so that it's a bit easier to enter something like this:

http://imageshack.com/a/img537/3466/5BN3sY.png
8 Jahre weitere
Is there a reason that you can't edit the value for the specification attribute? It would be much better if you when using option could change the value in a drop down list.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.