Created
June 27, 2012 09:52
-
-
Save jimmy-collazos/3003041 to your computer and use it in GitHub Desktop.
Esta función dispara un evento, asociado a un elemento con jQuery, dentro del control de Telerik; el nombre de evento se pasa como parámetro
This file contains hidden or 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 ejemplo asocia un evento 'OnGridCreated' para cuando el grid se haya creado --%> | |
<ClientSettings> | |
<Scrolling AllowScroll="True" UseStaticHeaders="True" /> | |
<ClientEvents OnRowCreated="" OnGridCreated="shootEventFromTelerik('OnGridCreated')" OnRowContextMenu=""/> | |
</ClientSettings> |
This file contains hidden or 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
/** | |
* Esta función dispara un evento dentro del control de Telerik con el nombre del evento que se le pasa como atributo. | |
* <ClientSettings> <ClientEvents {EventName}="shootEventFromTelerik({EventName})" /> </ClientSettings> | |
*/ | |
function shootEventFromTelerik(eventName) { | |
return function (sender, args) { | |
//console.log(eventName, sender, args) //para cuando no sabes que id tiene el elemento que invoca | |
//console.log(sender.Control || '#' + sender._clientStateFieldID); | |
jQuery(sender.Control || '#' + sender._clientStateFieldID).trigger(eventName, [sender, args]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment