Results 1 to 4 of 4

Thread: Calling a function from Ext.xTemplate

  1. #1
    Ext User
    Join Date
    Oct 2010
    Posts
    1

    Default Calling a function from Ext.xTemplate

    I have the problem in using this code:

    var abc = new Ext.xTemplate (
    '<b>Name: </b> : {name}',
    '</br><b>City: </b> : {city}',
    '</br><a onclick="abc('{name}')">View Address</a> '
    {
    abc: function(name)
    {
    }
    }

    ques: My requirement is to call a function abc, but giving error like 'Object Expected'; I tried to define this function in between <head> </head>, but not working. How to use this

  2. #2
    Sencha User
    Join Date
    Sep 2008
    Posts
    38

    Default

    your code is not clear and it has no valid syntax. If you write a clearer (and working) example I may try to give you a help. Please use CODE tag (the # in post formatting toolbar) when putting code examples.

  3. #3
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    You do not use inline event handlers in modern web apps.

    Add a click listener to your main element and use the delegate option to select the target element type.

    But that is not your code. There's no such class as "xTemplate"

  4. #4
    Ext JS Premium Member devtig's Avatar
    Join Date
    Jan 2010
    Location
    Rotterdam, The Netherlands
    Posts
    422

    Default

    djn, don't use a Javascript framework if you're not comfortable with Javascript itself.
    Christiaan Westerbeek @ Devotis
    Contact me for help with Ext JS, Node JS, FireBase, AngularJS and Javascript in general. Email me or find me at AirPair to connect.

Similar Threads

  1. Applet calling a js function in Ext namespace
    By irinchev in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 16 Jun 2008, 7:14 AM
  2. xTemplate calling function
    By mnask79 in forum Ext 1.x: Help & Discussion
    Replies: 0
    Last Post: 18 May 2008, 11:28 PM
  3. xtemplate and calling function
    By mnask in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 17 Mar 2008, 8:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •