custom jquery in views

64 views
Skip to first unread message

skd

unread,
Nov 5, 2012, 7:51:45 PM11/5/12
to batm...@googlegroups.com
Hey guys. I'm having a hard time getting custom views/mixins to call any sort of relevant custom jquery on my views and so am coming here hoping you guys can show me what im doing wrong. I have tried numerous things and nothing seems to work.

Case 1:
https://gist.github.com/4021551

I have tried binding a custom view to a node that wraps a content partial. I'm able to see what events get called as the node is inserted/removed from the DOM but I'm never able to reliable get something like this:

appear: ->
node.hide()
ready: ->
node.fadeIn()

Case 2:
https://gist.github.com/4021591

I've tried something similar to the above, just a different method. For this method, would I be calling those custom bindings from a controller at this point? (this particular section is a sort of tabbed view, where you click a tab link and it shows/hides relevant content)

Both of these methods I have seen 'used' here and in the documentation. However,I have not been able to get it to work reliably.

I guess my first question is:

- First, what is the preferred method for accomplishing this? and a followup question is,
- within that method is there a super simple example someone could show?

I see a few different cases where I could need this. When an object is added/removed from a collection, and another case would be just a generic show/hide functionality that I can attach to whatever. Also, on a somewhat related note. what are the differences between showif and renderif. Seems like they are similar but have subtle differences.

Thanks

Reply all
Reply to author
Forward
0 new messages