Dragging, dropping, and sorting with observableArrays - Knock Me Out:

Allowing items to be dropped between arrays

The next feature that I wanted to support was allowing an item to be dropped between multiple arrays. The logic necessary to make this happen is quite similar, but we need to know a little more information when an element is dropped. We need to know the data item, the itemโ€™s original parent array, and the itemโ€™s new array.

Purely a note to self.  I'm not the biggest knockoutjs fan.  It seems to encourage "foreach-ly verbose" mental modeling and TONS of behind the scenes overhead when used carelessly.  And handling jQuery/UI<>knockoutjs interactions essentially have you write enough of a translation layer that it feels like you're rewriting jQuery/UI.  You're kludging the two instead of doing it the right way with one.  Very VB6 Wizardy, where it'd bind to a datasource and make a really crappily bound form with |<, <, >, & >| buttons on it, allowing folks who couldn't spell VB to write 70% of what you needed in 10 minutes, making nontechnical pointy heads believe your task was almost done when all you really had was a programmer who had no idea what was going on.  Though admittedly that turned into a rant rather than a fair description of knockoutjs.  ;^)  But they're similar past a certain point.

Knockout is more like playing Guitar Hero, where if you get good enough at the game, you would've been better off spending that time learning to play at least the bass guitar and had a real skill.  If you get to be great at knockoutjs, you're great at knockoutjs.  Doesn't make you a great js coder if Guitar Hero isn't in front of you.  Learn to play the bass instead.  But maybe I'm still missing something here.

Labels: , , ,