Results 1 to 3 of 3

Thread: Ext.ComponentQuery: implementing a breadth-first search

  1. #1
    Sencha User
    Join Date
    Aug 2015
    Posts
    23
    Answers
    7
    Vote Rating
    1
      0  

    Default Ext.ComponentQuery: implementing a breadth-first search

    I'd like matches higher in the hierarchy to appear before matches lower in the hierarchy.

    440px-Sorted_binary_tree_breadth-first_traversal.svg.png

    For example, if nodes D, E, G, and H matched the search criteria, I would get the results in this order: G, D, E, H.

    visitPreOrder will return: D, E, G, H
    visitPostOrder will return: E, D, H, G

    Is there a way to implement this using the existing Ext.ComponentQuery functions? If I had a hook into the level, then I could do visitPreOrder, index by cardinality and level, then re-sort by level and cardinality.

  2. #2
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Redwood City
    Posts
    30,864
    Answers
    39
    Vote Rating
    88
      -1  

    Default

    http://docs.sencha.com/extjs/6.5.1/c...visitPostOrder

    And there's a preOrder version just below.
    Longtime Sencha engineer. Now surplus to requirements apparently...

  3. #3
    Sencha User
    Join Date
    Aug 2015
    Posts
    23
    Answers
    7
    Vote Rating
    1
      0  

    Default

    Quote Originally Posted by Animal View Post
    http://docs.sencha.com/extjs/6.5.1/c...visitPostOrder

    And there's a preOrder version just below.
    Neither of those are breadth-first searches, I even included the results of those searches to show that they weren't breadth-first searches.

Similar Threads

  1. Replies: 1
    Last Post: 8 Jul 2013, 1:21 PM
  2. problem while implementing free text search in sencha search field.
    By arihant0073 in forum Sencha Touch 1.x: Discussion
    Replies: 1
    Last Post: 27 Nov 2011, 7:20 AM
  3. ComponentQuery: search tools array
    By htammen in forum Ext: Discussion
    Replies: 2
    Last Post: 26 Feb 2011, 2:04 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •