Last active
August 29, 2015 14:14
-
-
Save dbarrionuevo/d498c738eb3149bf1f9a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Este tiene el bh que carga TransacSearchMembers --> | |
<a class="ura peluda"> | |
<div class="box-right"> | |
<form data-behavior="transac_search_add" id="407" action="..." method="post"> | |
... | |
... | |
</form> | |
</div> | |
</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Select a member for a transaction in the members search | |
YouConnect.Behaviors.TransacSearchAdd = Essential.Behavior.extend({ | |
init: function() { | |
// Este se muestra una vez por item, todo joya | |
console.log('init ADD'); | |
$(this.el).on("submit", function(e) { | |
// Jamas llega acá | |
e.preventDefault(); | |
}) | |
} | |
}); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
YouConnect.Behaviors.TransacSearchMembers = Essential.Behavior.extend({ | |
init: function() { | |
$(this.el).autocomplete({ | |
// Un millon de pijas de configuración del autocomplete | |
// ... | |
// ... | |
}).data( "ui-autocomplete" )._renderItem = function( ul, item ) { | |
// La estructura de cada item está abajo | |
// Load transac_search_add | |
Essential.loadBehaviors({ | |
context: $(item.outerHTML)[0], | |
application: window.YouConnect.Behaviors | |
}); | |
return $( "<li class='result-autocomplete'>" ).append(item.outerHTML).appendTo( ul ); | |
}; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment