Results 1 to 4 of 4

Thread: Changing the css dynamically for a span inside a div in a list itemTpl

  1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    20
    Vote Rating
    0
      0  

    Default Answered: Changing the css dynamically for a span inside a div in a list itemTpl

    Ext.define('Application.view.phone.AppScreen', {
    extend: 'Ext.navigation.View',
    // extend: 'Ext.Container',
    xtype: 'appscreen',id: 'appscreen',
    alias: 'widget.appscreen',
    config:
    { items:
    [{ xtype: 'container',
    title: 'My View',
    layout: { type: 'fit' },
    items:[{
    html:'phone'
    },
    { xtype:'list',
    id:'AccountSummary',
    name:'AccountSummary',
    onItemDisclosure:true,
    store:{ fields: ['Label', 'Amount'],
    data: [
    {
    "Label":"Order", "Amount": "18,275" },
    {
    "Label":"Shipment", "Amount": "25,255"
    },
    {
    "Label":"Invoices", "Amount": "11,125"
    }
    ] },
    itemTpl: new Ext.XTemplate('{Label}<tpl if="Label==Order"><div class="meter"><span style="width: 60%"></span></div></tpl><tpl if="Label==Shipment"><div class="meter1"><span style="width: 60%"></span></div></tpl><br>$ {Amount} Cash')

    I need to change the css dynamically for example if the label is order I need to apply the css meter,similarly meter1 for Shipment.There is a mistake in the itemTpl.Can someone please help me on this?

  2. Try
    Code:
    <tpl if="values.Label==\'Order\'">
    and
    Code:
    <tpl if="values.Label==\'Shipment\'">

  3. #2
    Sencha User jerome76's Avatar
    Join Date
    Apr 2012
    Location
    New Jersey
    Posts
    1,149
    Answers
    132
    Vote Rating
    101
      0  

    Default

    Try
    Code:
    <tpl if="values.Label==\'Order\'">
    and
    Code:
    <tpl if="values.Label==\'Shipment\'">

  4. #3
    Sencha User
    Join Date
    Jun 2012
    Posts
    20
    Vote Rating
    0
      0  

    Default

    Hey thanks a lot it worked.

  5. #4
    Sencha User jerome76's Avatar
    Join Date
    Apr 2012
    Location
    New Jersey
    Posts
    1,149
    Answers
    132
    Vote Rating
    101
      0  

    Default

    Great Just remember to mark it as answered if it fully solved the issue

Tags for this Thread

Posting Permissions

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