title: ExtJS XTemplate
body: <p>I am trying to develop a FilterEditor using ExtJS.
  user creates some range, comparison, null/notnull criterias and I need to present them in a well-formatted format, so that users can read the overall criteria easily.</p>
  
  <p>For this, I tought Ext.DataView and XTemplates would do the trick. But I am wondering if I can provide more than one template to makes templates maintainable, or use some built-in functionality to select a piece of the template for me.</p>
  
  <pre><code>   var dateRangeTpl = new Ext.XTemplate(
     '&lt;tpl for="."&gt;',
          '&lt;div id="{CriteriaId}"&gt;',
              '&lt;em&gt;{FieldName} &lt;/em&gt;',
              '&lt;span&gt;{Modifier} &lt;/span&gt;',
              '&lt;span&gt;{Condition} &lt;/span&gt;',
              '&lt;span&gt;{LeftDate} &lt;/span&gt;',
              '&lt;span&gt;{RightDate} &lt;/span&gt;',
          '&lt;/div&gt;',
      '&lt;/tpl&gt;',
      '&lt;div class="x-clear"&gt;&lt;/div&gt;'
  
     var notNullTpl = new Ext.XTemplate(
     '&lt;tpl for="."&gt;',
          '&lt;div id="{CriteriaId}"&gt;',
              '&lt;em&gt;{FieldName} &lt;/em&gt;',
              '&lt;span&gt;{Modifier} &lt;/span&gt;',
              '&lt;span&gt;{Condition} &lt;/span&gt;',
          '&lt;/div&gt;',
      '&lt;/tpl&gt;',
      '&lt;div class="x-clear"&gt;&lt;/div&gt;'
  </code></pre>
  
  <p>output: </p>
  
  <pre><code>Invoice Date not between 2011-01-01 2011-01-31
  Invoice Date not null
  </code></pre>
  
  <p>There will be a lot of templates, I am thinking of providing some inline data editors, so most probably this will grow in numbers. I know I can do some simple  blocks it might grow big and complicated so I wanted some opinions before I dive into it.</p>