Click to search on your search term.
Subscribe to Fig Leaf Tutorials


Need help with a project? Contact us at sales@figleaf.com.
From code reviews to project "jumpstarts" and full life-cycle development, we've got you covered!
Check out our case studies!
Follow us on Twitter!
Click here to join our Facebook group!

Ready to upgrade your skills? Try these instructor-led classes in Washington, DC:
Ext JS 6 Bootcamp
12/04/2017

Executing Inline JavaScript

Page of 168

Using the special delimiter {[ ... ]} enables you to execute any inline JavaScript, including the data formatting methods of the Ext.util, Ext.String, Ext.Number, and Ext.Date classes. Within a {[ ... ]} block you also can access the following template variables:

  • values: The values in the current scope.
  • parent: The scope (values) of an ancestor template.
  • xindex: If you are in a looping template, this variable represents the index of the loop that you are in (1-based).
  • xcount: If you are in a looping template, this variable represents the total length of the array that you are iterating through.

Note that inside of a {[...]} delimiter, you must refer to the record's data properties as {[values.fieldName]} instead of {fieldName} as had been illustrated previously.

 

var tpl = Ext.create('Ext.XTemplate', 
 '
    ', '', '
  • ', '{fName} {lName}', '
  • ', '
    ', '
' );
Page of 168
comments powered by Disqus