| 15 | |
| 16 | // Public methods |
| 17 | public run(): void{ |
| 18 | // We copy the render link so we can use it in the functions below |
| 19 | var renderLink: RenderLinkSimpleInput = this; |
| 20 | |
| 21 | // If the default value isn't null |
| 22 | if(this.defaultValue != null){ |
| 23 | // We set the default value |
| 24 | $(this.element).val(this.defaultValue); |
| 25 | } |
| 26 | |
| 27 | // We set the change event |
| 28 | $(this.element).change(function(event){ |
| 29 | // We fire the callback collection |
| 30 | renderLink.callbackCollection.fire(); |
| 31 | |
| 32 | return false; // Avoid event bubbling |
| 33 | }); |
| 34 | |
| 35 | if(this.hasFocus) $(this.element).focus(); |
| 36 | } |
| 37 | } |