Olivier, I Love your example. I am trying to use this with local storage. I took out some of the external stuff like the permissions. I am trying to resize. However, It seems like The place holder does not resize. and when I resize, the console throws an error at me saying $scope does not have method sizeContent. Its coming from line 183 in 0-gridster.js
On Friday, July 5, 2013 1:33:55 PM UTC-5, Olivier Clément wrote: > > Reviving this old thread: > > I am looking into doing the same thing + resizable; > I started working on it, based off of your plunk, Ryan (thanks for that > great starting point). > > Code is here: https://github.com/OClement/Dashboard-PoC - Still a WIP > obviously > > I am currently having a problem when adding a new widget though; > > I "require: '^gridster'" from the widget directive, which work fine until > I add a new widget to the model it complains it can't find 'gridster' > > Anyone have an idea of what's going on? > > Thanks > > On Sunday, November 25, 2012 11:14:26 PM UTC-5, Ryan Randall wrote: >> >> I see $timeout like this... >> >> $timeout(function() { >> do this once you've finished doing whatever else you're doing >> }); >> >> The first instance of $timeout is applying the gridster function to the >> ul element. If you do that before the li elements are all set it won't work >> properly. Using the $timeout makes sure the li elements are all set before >> you gridster-ize them. >> >> The second instance of $timeout is similar. When you click the add >> button, the model changes and angular changes the DOM accordingly. You need >> to wait for that to be done before you gridster-ize the new li element, so >> we just wrap the gridster-izing stuff in a $timeout. >> >> I hope that helps... >> >> Cheers, >> Ryan >> >> >> On Monday, 26 November 2012 02:15:34 UTC, Tucker Watson wrote: >>> >>> Ryan, thanks so much for the excellent example! I have been spending a >>> lot of time trying to clean up my version but yours is much more elegant >>> and works perfectly. It will be a great resource. >>> >>> I've figured everything out in your code except the two instances of >>> $timeout. It seems removing either will break it, but I can't make sense >>> of it. Thanks again for the help! >>> >>> On Sunday, November 25, 2012 6:58:57 PM UTC-5, Ryan Randall wrote: >>>> >>>> Hi Tucker, >>>> >>>> Here's my stab at implementing a gridster directive: >>>> http://plnkr.co/edit/J2aPj0?p=preview >>>> >>>> Cheers, >>>> Ryan >>>> >>>> On Friday, 23 November 2012 23:21:21 UTC, Tucker Watson wrote: >>>>> >>>>> Well I finally figured out a solution, although it seems more of a >>>>> hack than a solution. After some reading and testing I figured out that >>>>> DOM manipulation outside of Angular isn't detected, thus needs to >>>>> manually >>>>> update the model and then the scope needs to be notified by $apply(). My >>>>> solution listens for anytime a widget stops dragging and then updates the >>>>> x/y of every widget. >>>>> >>>>> http://jsfiddle.net/tuckwat/psnfS/ >>>>> >>>>> I'm guessing this should be done in a directive but I couldn't figure >>>>> it out - anyone have some pointers on how to accomplish something like >>>>> this? >>>>> >>>>> On Wednesday, November 21, 2012 4:02:40 PM UTC-5, Tucker Watson wrote: >>>>>> >>>>>> Hey all - I'm starting to learn Angular and one of my first projects >>>>>> involves Gridster.js <http://www.gridster.net> and so far I've been >>>>>> unsuccessful at creating a working directive. Gridster seems to >>>>>> automatically work off of *li* elements but I decided to use my own >>>>>> directive and try to manually add it to Gridster. However, I can't seem >>>>>> to >>>>>> get the two-way binding or watches to work doing it this way. I have >>>>>> some >>>>>> other ideas about how to implement it but I keep feeling like I'm >>>>>> approaching this the wrong way. Any assistance would be appreciated. >>>>>> >>>>>> Anyways, progress so far: http://jsfiddle.net/tuckwat/KNTUG/ >>>>>> >>>>>> -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
