Giter Club home page Giter Club logo

Comments (7)

carlosalvidrez avatar carlosalvidrez commented on July 23, 2024 1

That was it! Thank you.
I appreciate your follow-up.
Great library, thanks again!

from jquery_jeditable.

NicolasCARPi avatar NicolasCARPi commented on July 23, 2024

See: https://github.com/NicolasCARPi/jquery_jeditable/#submitting-to-function-instead-of-url

from jquery_jeditable.

carlosalvidrez avatar carlosalvidrez commented on July 23, 2024

Thanks for the quick response... I implement that, but I can't find the original element's id in any of the function accessible objects... neither "this", "value" or "settings". I realize I might be missing something. I'm just stomped.

Great work by the way, thanks for sharing!

from jquery_jeditable.

NicolasCARPi avatar NicolasCARPi commented on July 23, 2024

That would be $(this).attr('id').

from jquery_jeditable.

carlosalvidrez avatar carlosalvidrez commented on July 23, 2024

Great, thanks!

from jquery_jeditable.

carlosalvidrez avatar carlosalvidrez commented on July 23, 2024

Hi Nicolas, just wanted to let you know I tried it, and I'm still not able to get the id, or any other attribute from the node being edited. Here is a quick snippet showing you everything I tried. Hope you can shed some light into this or publish a basic example showing this succeeding. Thanks!!

$('.editable').editable(
    (value, settings) => {

        const new_value = value.trim();

        console.log(sn, "- this:", $(this));
        console.log(sn, "- this 2:", this);
        console.log(sn, "- this id:", $(this).attr('id'));
        console.log(sn, "- this id v2:", this.parentNode.getAttribute('id'));
        console.log(sn, "- this id v2:", $(this).parentNode.getAttribute('id'));
        console.log(sn, "- this data-assignment-id:", $(this).attr('data-assignment-id'));

from jquery_jeditable.

NicolasCARPi avatar NicolasCARPi commented on July 23, 2024

I suspect it's because you're using an arrow function, and it impacts what is "this". Try with a normal function.

from jquery_jeditable.

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.