Saturday 15 August 2015

function - Trigger onload event in Backbone js -


OK, I have a script that has been created in jQuery, on the document preparation event, the only thing in the spinal cord How to do? And where should I put my script, then: Router, view or model?

See my header here

  window.HeaderView = Backbone.View.extend ({initialize: function (option) {this.render ();}, Event: { Click on "click .Filter_button": "filter_navigation", "click.search_button": "live_filter_button", "keyup #live_filter": "search"}, filter_navigation: function (e) {e.prevent default (); $ ( $ '(Filter'). ToggleClass ('active'); $ ('search.') RemoveClass ('active');}, live_filter_button: function (e) {e ('.'); $ ('.filter' RemoveClass ('active');}, search: function (e) {var searchText = $ ("#live_filter"). Val (). ToLowerCase (); $ allListElements = $ ('. Project_element'); $ MailingList Elements = $ AllListElements.filter (Function (i, l) {return $ (l) .text (). ToLowerCase () .indexOf (searchText)! == -1;}); $ allListElements.hide (); $ mailing listElements.Show ();} , Render: function () {$ (this.el) .html (this.template ()); back to it;}});    

You can execute script code in the render event and You can include the script itself in the html file ... ex:

  var bookmark = backbone.View Extension ({template: _.template (รข ?? |), Render: function () {this. $ El.html (this.template (this.model.attributes)); back;}});    

1 comment:

  1. Giuseppe: Function - Trigger Onload Event In Backbone Js - >>>>> Download Now

    >>>>> Download Full

    Giuseppe: Function - Trigger Onload Event In Backbone Js - >>>>> Download LINK

    >>>>> Download Now

    Giuseppe: Function - Trigger Onload Event In Backbone Js - >>>>> Download Full

    >>>>> Download LINK Ju

    ReplyDelete