Git Product home page Git Product logo

Comments (15)

ericxin1982 avatar ericxin1982 commented on July 3, 2024

And the indicator chapter, how you add the aira-busy class to target table, that is not clear enough. Would you please share?

from alpine-ajax.

imacrayon avatar imacrayon commented on July 3, 2024

Hi!

Do you think you would have x-ref available to replace x-target

That’s not likely to happen because we need a unique identifier on the page so that we know what content to merge inside an incoming request. x-ref is only unique per component, but id is required to be unique per page.

how you add the aira-busy class to target table

aria-busy is automatically added to a target when it is updating. You only need to write the CSS to make an indicator show when aria-busy is present.

from alpine-ajax.

ericxin1982 avatar ericxin1982 commented on July 3, 2024

That means aria-busy this css just prepared there, then indicator would take it if indicator tag is used, that is what you meant?

from alpine-ajax.

ericxin1982 avatar ericxin1982 commented on July 3, 2024

Then x-target can accept dynamic id? I mean the target id can be generated after it is being loaded into webpage.

from alpine-ajax.

imacrayon avatar imacrayon commented on July 3, 2024

That means aria-busy this css just prepared there, then indicator would take it if indicator tag is used, that is what you meant?

Yes, I think that's about right. There's not an indicator "tag" but you create the indicator by checking if aria-busy is present on a target using a CSS selector. I made a some quick demos that might help explain it better: https://codepen.io/imacrayon/pen/JjzGeMa

from alpine-ajax.

ericxin1982 avatar ericxin1982 commented on July 3, 2024

Then x-target can accept dynamic id? I mean the target id can be generated after it is being loaded into webpage.
hi @imacrayon,

I have this concern, thanks. Please help me verify it.

from alpine-ajax.

imacrayon avatar imacrayon commented on July 3, 2024

Yes the ID in x-target can be dynamic you can include more than one ID too.

from alpine-ajax.

ericxin1982 avatar ericxin1982 commented on July 3, 2024

That is great, thanks for your help.

from alpine-ajax.

ericxin1982 avatar ericxin1982 commented on July 3, 2024

I saw all the examples, the whole alpine-ajax must be used within a form element? That is a must?

from alpine-ajax.

ericxin1982 avatar ericxin1982 commented on July 3, 2024

Can you give me more $ajax example, I try to understand it better, and think about how to use it properly.

from alpine-ajax.

ericxin1982 avatar ericxin1982 commented on July 3, 2024

Sorry, @imacrayon

I have one more question, how to add request header through $ajax to server, not the X-Alpine-Request I am talking about.

Thanks
Eric Xin

from alpine-ajax.

imacrayon avatar imacrayon commented on July 3, 2024

No way to customize headers yet. That will probably be coming soon though.

from alpine-ajax.

ericxin1982 avatar ericxin1982 commented on July 3, 2024

Ok, then how about $ajax, we can use it in any element right?

from alpine-ajax.

imacrayon avatar imacrayon commented on July 3, 2024

Yeah, just like any other Alpine magic, you can use it within any event handler on any element.

from alpine-ajax.

ericxin1982 avatar ericxin1982 commented on July 3, 2024

That is excellent, good news to know.

from alpine-ajax.

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.