-
14 Jun 2012 8:15 AM #1
Unanswered: jquery in template
Unanswered: jquery in template
Hi, i was trying to use jquery in template, the questions is for example if in my template i wanna use Jquery but calling from other file where is my function, is possible?:
Function Jquery
Dataview TemplateCode:$(document).ready(function(){ $('#i_n_f').blur(function() { alert('Handler for .blur() called.'); }); });
Code:Ext.define('MyApp.view.MyView', { extend: 'Ext.view.View', height: 250, width: 400, autoScroll: true, itemSelector: 'div', store: 'users', initComponent: function() { var me = this; Ext.applyIf(me, { tpl: [ '<tpl for="."><div><td><input value="" type="text" id="i_n_f" name="i_n_f" maxlength="12" class="span3"></td></div></tpl>' ] }); me.callParent(arguments); } });
I am calling like this in my APP
Code:<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>ejemtem3</title> <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-4.0.7-commercial/resources/css/ext-all.css"/> <script type="text/javascript" src="http://extjs.cachefly.net/ext-4.0.7-commercial/ext-all-debug.js"></script> <script type="text/javascript" src="app.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script type="text/javascript" src="http://127.0.0.1/myfunction/js_ssep.js"></script> </head>
-
14 Jun 2012 8:46 AM #2Sencha - Support Team
- Join Date
- Jul 2010
- Location
- Houston, Tx
- Posts
- 7,183
- Vote Rating
- 194
- Answers
- 433
Here is any article regarding Ext4 and JQuery:
http://loianegroner.com/2011/08/how-...uery-together/
But I have not tried to use it in a XTemplate before. If the article does not help, perhaps someone can jump in and provide some info to help.
Regards,
Scott.
-
14 Jun 2012 10:10 AM #3
I saw this but doesnt help, somebody have some idea?
-
14 Jun 2012 3:19 PM #4Sencha - Ext JS Dev Team
- Join Date
- Apr 2007
- Location
- Sydney, Australia
- Posts
- 15,067
- Vote Rating
- 96
- Answers
- 166
1) You're likely applying it too early, the view isn't created yet
2) It's not really wise to be creating multiple elements with the same idEvan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
15 Jun 2012 5:05 AM #5
Thanks for the answer, and how i can give some property to the view for not be so early, even with one doesn't work, dont know what to do, so manny days trying, somebody have some idea?



Reply With Quote