1. #1
    Sencha User crocop21's Avatar
    Join Date
    May 2012
    Posts
    65
    Vote Rating
    0
    crocop21 is an unknown quantity at this point

      0  

    Default 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
    Code:
    $(document).ready(function(){   
        $('#i_n_f').blur(function() {
      alert('Handler for .blur() called.');
    });
    });
    Dataview Template
    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>

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,197
    Vote Rating
    482
    Answers
    690
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    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.

  3. #3
    Sencha User crocop21's Avatar
    Join Date
    May 2012
    Posts
    65
    Vote Rating
    0
    crocop21 is an unknown quantity at this point

      0  

    Default


    I saw this but doesnt help, somebody have some idea?

  4. #4
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,170
    Vote Rating
    674
    Answers
    474
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    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 id
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  5. #5
    Sencha User crocop21's Avatar
    Join Date
    May 2012
    Posts
    65
    Vote Rating
    0
    crocop21 is an unknown quantity at this point

      0  

    Default


    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?

Thread Participants: 2