Forums
View unanswered posts | View active topics It is currently Mon Nov 24, 2014 7:46 pm



Reply to topic  [ 3 posts ] 
 Have a list of all the items in the Page that has PIE 
Author Message

Joined: Mon Mar 26, 2012 1:04 pm
Posts: 3
Post Have a list of all the items in the Page that has PIE
Hi All

I have an issue in my project to maintain all the items that have PIE behaviour.
I have a Web 2.0 page so dynamically rendering different part of the page, as a result i have to update the position and size of the pie container after a render happen.

Solution:
I am adding a registory, that holds all the reff of the componets @ init and call the update on all the items

Code:
 PIE[ 'attach' ] = function (el) {
            if (PIE.ieDocMode < 10 && PIE.supportsVML) {
                PIE.Element.getInstance(el).init();
                PIE.Element.setPieIndex(el,PIE._registry.length)
                PIE._registry.push(el)

            }
        };
        /**
         * Programatically detach PIE from a single element.
         * @param {Element} el
         */
        PIE[ 'detach' ] = function (el) {
            PIE._registry.splice(PIE.Element.getPieIndex(el),1)
            PIE.Element.destroy(el);
        };

        PIE['updateAll'] = function () {
            for (var pieIndex = 0, pieLength = PIE._registry.length; pieIndex < pieLength; pieIndex++) {
                PIE.Element.getInstance(PIE._registry[pieIndex]).update()
            }
        }


Tue Mar 27, 2012 12:08 pm
Profile

Joined: Mon Mar 26, 2012 1:04 pm
Posts: 3
Post Re: Have a list of all the items in the Page that has PIE
Found another way

Code:
         Element.updateAll = function () {
                if (wrappers) {
                    for (var wrapper in wrappers) {
                        wrappers[wrapper].update()
                    }
                }
            }

and
Code:
        PIE['updateAll'] = function () {
            PIE.Element.updateAll()
        }


Tue Mar 27, 2012 12:31 pm
Profile

Joined: Thu Apr 07, 2011 3:23 am
Posts: 73
Post Re: Have a list of all the items in the Page that has PIE
You can also remark that all the PIE'd elements get an attribute called "_pieId".
That means you can get that list with a simple jQuery DOM query: $("[_pieId]");

(Also works with Prototype : $$("[_pieId]"); )

once you have this nodeList, you can easily perform attach() and detach() on its members.


Wed May 30, 2012 10:17 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.