Giter VIP home page Giter VIP logo

Comments (7)

davidsantiago avatar davidsantiago commented on June 14, 2024

I don't know jquery. What does that do?

from hickory.

ioRekz avatar ioRekz commented on June 14, 2024

Of course. When selecting a node in the tree. You can call parent on it and get its parent.
I have a use case is the page I try to get data from where one deep node got a class I can lookup but not the "parent" I want to. So I need to go down to this element and get the ascendant

from hickory.

davidsantiago avatar davidsantiago commented on June 14, 2024

Oh, OK, I see. You can absolutely do this.

Normally the select function returns a list of nodes, but you can also get a list of zipper-locs instead. You can do that by calling select-locs instead of select. Then each item in the vector that is returned by select-locs will be a zipper, usable with all of the tree navigation functions of clojure.zip. So you'd call select-locs, instead of select, and then use clojure.zip/up on each of those to get their parents. As with any zipper, you'd want to call clojure.zip/node to get the node that you can examine before looking at it.

from hickory.

vspinu avatar vspinu commented on June 14, 2024

Any news on this? You can do all other directions, child, follow and precede, but not parent. So you can currently get both A and C in (A B C) but only C in (A (B (C))).

from hickory.

davidsantiago avatar davidsantiago commented on June 14, 2024

Are you asking about a selector function? Doesn't the has-child selector do what you want?

from hickory.

vspinu avatar vspinu commented on June 14, 2024

Right. That's exactly what I was looking for. Don't understand how I missed it in the docs. Thanks!!!

from hickory.

port19x avatar port19x commented on June 14, 2024

Closing in favor of #40

from hickory.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.