Git Product home page Git Product logo

Comments (5)

streetrider avatar streetrider commented on June 19, 2024

Hi Max -

Thank you for the feedback! Our developer is on vacation until June 12th, so any technical issues or requests will experience delay in response. We'll make sure to keep you posted.

The MixItUp Team

from mixitup.

patrickkunka avatar patrickkunka commented on June 19, 2024

Hey Maxkeung,

If I understand you correctly, are you requesting that if a data attribute changes after MixItUp has instantiated, MixItUp would re-sort elements accordingly automatically?

This should already be possible if you write some custom javascript that runs after you change the data attribute, essentially just firing the sort method. I haven't tested it but i'm pretty sure it would work.

If I've misunderstood you, please clarify!

Thanks for the feedback,

Patrick

from mixitup.

maxkueng avatar maxkueng commented on June 19, 2024

Hey Patrick

thanks for the reply!

What I meant is that when setting data properties using jQuery's data function, mixitup doesn't recognize it. The data function stores data in a jQuery-internal object and does not modify the element's DOM attributes, so the stored data is not accessible through the attr function.

Consider this:

var bdy = $('body');
bdy.data('magic', 'unicorns');

console.log(bdy.attr('data-magic')); // undefined (or null)

At the same time:

var bdy = $('body');
bdy.attr('data-magic', 'unicorns');

console.log(bdy.data('magic')); // unicorns

Because mixitup uses the attr function to access data-* attributes throughout, it doesn't work with data set with the data function.

Best regards
Max

from mixitup.

johnwiseheart avatar johnwiseheart commented on June 19, 2024

So is there a work around for this? Or is it not possible?

from mixitup.

maxkueng avatar maxkueng commented on June 19, 2024

The workaround is to use actual "data-*" attributes instead of the data() function. But I haven't used in a while. This is just as far as I remember.

Basically you have to do this

$('#myListItem').attr('data-wizardlevel', 100);

instead of

$('#myListItem').data('wizardlevel', 100);

from mixitup.

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.