You are here: Foswiki>Tasks Web>Item15302 (26 Apr 2024, MichaelDaum)Edit Attach

Item15302: Missing RegExp in filter.js for category inline filtering. (Applications.ClassificationApp.RenderCategory/filter.js)

pencil
Priority: Normal
Current State: Confirmed
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: ClassificationApp
Branches:
Reported By: JonMcCoy
Waiting For:
Last Change By: MichaelDaum
When RenderCategory renders the filter, inline filtering doesn't work. The JS is missing a RegExp definition in filter.js, so doesn't work in its stock form.

--- original_filter.js   2024-04-25 23:29:32
+++ new_filter.js   2024-04-25 23:29:34
@@ -1,7 +1,8 @@
 jQuery(function($) {
    function updateCategoryIndex(val) {
+      var regex = new RegExp(val, "i");
          var $this = $(this), text = $this.text(); 
          if (!regex.test(text)) { 
             $this.fadeOut(); 

I fixed by adding the missing RegExp definition, and also fixed the JQuery selectors, as they didn't quite work with the existing HTML either.

-- JonMcCoy - 25 Apr 2024

Just dawned on me, the JQuery selector fixes above are because I have a table rendering list view, so I've removed those from the diff above. It's just the single line that's missing.

-- JonMcCoy - 26 Apr 2024

Thanks. The final fix is changing a bit more, i.e. if there are multiple containers on the same page. For now the above hotfix is perfect.

-- MichaelDaum - 26 Apr 2024
 

ItemTemplate edit

Summary Missing RegExp in filter.js for category inline filtering. (RenderCategory/filter.js)
ReportedBy JonMcCoy
Codebase
SVN Range
AppliesTo Extension
Component ClassificationApp
Priority Normal
CurrentState Confirmed
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release02x01Checkins
Release02x00Checkins
Release01x01Checkins
Topic revision: r4 - 26 Apr 2024, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy