Very nice. Relatively easy to follow. Basically it's re-implementing the drag-list behaviour in React. I had thought to re-use some existing code, provided I could inform React that the DOM was changing. (This is the approach used by the example in the fiddler, albeit with jquery instead of goog.closure as the UI manipulation library)
I'm very interested to see what you do with this, in Om. This example is complex enough that following along would most likely fill in the conceptual gaps for me, that the TODO example lacks. Again - inspiring work.. -- David On Monday, December 30, 2013 10:02:37 PM UTC-8, David Nolen wrote: > > From a React dev: > > https://www.khanacademy.org/preview/content/items/xfa03b103 > https://github.com/Khan/perseus/blob/master/src/widgets/orderer.jsx#L6-L439 > > I'm sure this can be adapted for Om. I may write up a simpler Om example > in the future. > > David > > > On Tue, Dec 31, 2013 at 12:43 AM, David Pidcock > <eraz0...@gmail.com<javascript:> > > wrote: > >> On Thursday, December 19, 2013 11:12:12 AM UTC-8, David Nolen wrote: >> > Enjoy, >> http://swannodette.github.io/2013/12/17/the-future-of-javascript-mvcs/ >> > >> > >> > >> > David >> >> I've been playing around with some basics. I'm still a relative n00b when >> it comes to functional programming, and I've never looked at React before. >> >> Very cool stuff. >> >> I managed to get Om+React to display a list of items that are sorted by a >> given key, and I have a content-editable span which updates the state of >> the owner with new value of that key for a given item, and voila! the list >> item moves to the correct position. (as expected) >> >> Now here's the tricky part... >> I want to implement a drag-list, where I can drag-drop items into a new >> position, and update the key based on the new position. I have that >> algorithm working in a different project (using goog.DragListGroup) , but >> React does not like you to manipulate the DOM outside it's knowledge. >> >> I found this : >> >> https://groups.google.com/forum/#!searchin/reactjs/sortable/reactjs/mHfBGI3Qwz4/rXSr-1QUcKwJ >> >> which lead to >> http://jsfiddle.net/LQxy7/ >> >> Unfortunately, I can't get this to work with Om. I am having trouble >> navigating the data structures. >> >> How are "props" created/accessed? I followed the TodoMVC example, but >> that seems to be using "state", which I am given to understand should be >> kept as high in the hierarchy as possible (per the React recommendations). >> I tried something like (:value (om/get-props this)) from within IRender, >> but that doesn't work. Also : (om/get-props this [:items] ) (following the >> idiom established by get-state. >> >> I'm probably missing something obvious, so I thought I'd pop in here to >> see if there's someone who can point me in the right direction. >> >> >> -- >> -- >> You received this message because you are subscribed to the Google >> Groups "Clojure" group. >> To post to this group, send email to clo...@googlegroups.com<javascript:> >> Note that posts from new members are moderated - please be patient with >> your first post. >> To unsubscribe from this group, send email to >> clojure+u...@googlegroups.com <javascript:> >> For more options, visit this group at >> http://groups.google.com/group/clojure?hl=en >> --- >> You received this message because you are subscribed to the Google Groups >> "Clojure" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to clojure+u...@googlegroups.com <javascript:>. >> For more options, visit https://groups.google.com/groups/opt_out. >> > > -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.