Problem/Motivation

1. Create a node view

Routine1:
Step1: Add filter Content: Type. Now you can see the following image.
@see: filter_initial.png
Step2: When we click Select All option, my all content type get checked.
@see: check_select_all.png
Step3: When we uncheck the Article option, Select All option also get unchecked.
@see: uncheck_article.png
Step4: Once again i check Article option, now all the two content type in check status, but Select All option still in Unchecked state.
@see: still_uncheck_select_all.png

Routine2:
Now do the Step1 once again. You can see the following image.
@see: filter_initial.png
Step5: Check the Article and the Basic page option. But still Select All option in uncheck state.
@see: still_uncheck_select_all.png

Issue: Select All functionality need to review.

Proposed resolution

To be determined.

Remaining tasks

To be determined.

User interface changes

Not Applicable.

API changes

Not Applicable.

Files: 
CommentFileSizeAuthor
#15 core-viewsui-selectall-1967800-15.patch1.51 KBnod_
PASSED: [[SimpleTest]]: [MySQL] 57,966 pass(es). View
#13 core-viewsui-selectall-1967800-11.patch1.51 KBnod_
PASSED: [[SimpleTest]]: [MySQL] 57,584 pass(es). View
#10 vdc-1967800-10.patch1.52 KBdawehner
PASSED: [[SimpleTest]]: [MySQL] 56,765 pass(es). View
#2 views_ui-1967800-1.patch1.47 KBvineet.osscube
PASSED: [[SimpleTest]]: [MySQL] 54,487 pass(es). View
still_uncheck_select_all.png115.79 KBsarav.din33
filter_initial.png123.87 KBsarav.din33
uncheck_article.png112.67 KBsarav.din33
check_select_all.png113.17 KBsarav.din33
filter_initial.png123.87 KBsarav.din33

Comments

vineet.osscube’s picture

Assigned: Unassigned » vineet.osscube

Assigned

vineet.osscube’s picture

Status: Active » Needs review
FileSize
1.47 KB
PASSED: [[SimpleTest]]: [MySQL] 54,487 pass(es). View

So initial patch for first review :)-

aspilicious’s picture

Issue tags: +VDC

Adding vdc tag

sarav.din33’s picture

Status: Needs review » Reviewed & tested by the community

I applied #2 patch. It working fine. @vineet.osscube Thanks for this patch.

sarav.din33’s picture

I applied #2 patch. Its working fine. @vineet.osscube thanks for this patch.

tim.plunkett’s picture

Assigned: vineet.osscube » nod_
Status: Reviewed & tested by the community » Needs review
Issue tags: +JavaScript

I'm unsure about the attr/prop switch, asking for a second opinion.

Also the comments are misformatted.

andymartha’s picture

If Drupal 8 is shipping with Jquery >= 1.6, it should be prop. Attr is a legacy term for all Jquery. However, I thought the form was $("#domelement").prop("checked", true) rather than "checked" checked. I might have to look that one up again to verify.

nod_’s picture

Status: Needs review » Needs work

does not pass JSHint validation.
We don't use .size(), just .length directly.
also the code can be changed to have only one select of $('.form-type-checkboxes:visible').find('input[type=checkbox]') and filter that afterwards for visible items only. Haven't checked the HTML but i hope there is a more specific selector so we don't need the checkbox - 1.

.prop() use in the patch is correct though.

nod_’s picture

Assigned: nod_ » Unassigned
dawehner’s picture

Status: Needs work » Needs review
FileSize
1.52 KB
PASSED: [[SimpleTest]]: [MySQL] 56,765 pass(es). View
  • Used a different selector
  • Adapted some comments.
nod_’s picture

Priority: Minor » Normal

#2012142: Update to jQuery 2.0.3 and rerolled.

Changed a bit the logic for checking the select all, Instead of substracting total number of checkboxes with numbe rof checked ones. I'm directly getting the number of unchecked checkboxes (excluding the select all checkbox) if that's 0, select all is checked. Pretty much the same, it's just one DOM selection less.

jibran’s picture

Status: Needs review » Needs work

Patch missing.

nod_’s picture

Status: Needs work » Needs review
FileSize
1.51 KB
PASSED: [[SimpleTest]]: [MySQL] 57,584 pass(es). View

loool

jibran’s picture

Status: Needs review » Needs work
@@ -769,17 +769,20 @@ Drupal.behaviors.viewsFilterConfigSelectAll = {
+        $(this).parents('.form-checkboxes').find('input[type=checkbox]').prop('checked', checked);

I think we have replaced all the parents call with closest in core.

nod_’s picture

Status: Needs work » Needs review
FileSize
1.51 KB
PASSED: [[SimpleTest]]: [MySQL] 57,966 pass(es). View
Spleshka’s picture

Status: Needs review » Needs work
  var checked = $(this).is(':checked');

Should we change this to var checked = $(this).prop('checked'); ?

   $(this).closest('.form-checkboxes').find('input[type=checkbox]').prop('checked', checked);

As far as I know, input[type="checkbox"] should work slightly faster, because in this case jquery will call querySelectorAll() that uses browser tools for elements searching, while the second variant will grep all elements using jQuery. But the results will be the same.

  var unchecked = $('.form-item-options-value:visible').find('input[type=checkbox]').not(':checked, #edit-options-value-all').length;

Possibly, we need to use context here?

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.