Coder Social home page Coder Social logo

Comments (3)

vollyimnetz avatar vollyimnetz commented on August 23, 2024

I found a quick-fix,
change

//get all list items new height
var item, $item, clone;
for (i = 0, ln = listElms.length; i < ln; i++) {
    item = listElms[i];
    $item = single(item);

    //create clone of item to calculate proper height
    clone = $item.clone();
    clone.addClass('ag-no-transition');
    clone.css('width', colWidth + 'px');
    $item.after(clone);

    listElmHeights.push(clone[0].offsetHeight);
    clone.remove();
}

to

//get all list items new height
var item, $item, clone;
for (i = 0, ln = listElms.length; i < ln; i++) {
    item = listElms[i];
    $item = single(item);

// ##########################################
    //define defaultValues if not set
    var reset = {
        top:'0px',
        lef:'0px'
    };
    if($item.css('top')==='auto') {
        $item.css(reset);
    }
// ##########################################

    //create clone of item to calculate proper height
    clone = $item.clone();
    clone.addClass('ag-no-transition');
    clone.css('width', colWidth + 'px');
    $item.after(clone);

    listElmHeights.push(clone[0].offsetHeight);
    clone.remove();
}

That looks a little bit better. But it would be great if we have also animations when elements are leaving the array - don't know if there is any event one can hook into.

from angulargrid.

s-yadav avatar s-yadav commented on August 23, 2024

Thanks vollyimnetz, for providing great explanation for your issue.

There is problem with filter, as ng-repeat does not trigger any event when element added or removed (there is scope watch, but will not help with this specific problem), and also it will not wait for the leaving element to complete animation, and removes them from DOM,
I guess the proper solution will be to have custom repeat directive for the plugin, and check for model changes and listen transitionend event, for smooth transition.

I will try experimenting for the solution of this problem, it may take some time as I am quite busy with other projects, but I will try to fix this as soon as possible.

from angulargrid.

s-yadav avatar s-yadav commented on August 23, 2024

Hi vollyimnetz,
Check for the latest commit, It included animation support using ngAnimate module,
Check demo on http://ignitersworld.com/lab/angulargrid/

from angulargrid.

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.