Search code examples
sencha-touchextjssencha-touch-2sencha-charts

How to hide the NULL values in list item get from store in sencha touch


enter image description hereI have implemented an application in sencha touch.

in that i have a list view , i retrieve the data from the store,

in data base in some fields i have inserted null values,{No selection}.

the corresponding fields in list view are displayed as NULL,

But i want to display an empty space instead of NULL,

        {
                  xtype: 'list',

                  itemTpl: [
                            '<div id="wrapper">'+
                            '<div class="frt">{Name}</div>'+
                            '<div class="frt">{Title}</div>'+
                            '<div class="frt">{Contact}</div>'+
                            '<div class="frt">{Zip}</div>'+
                            '</div>'
                            ],
                  store: 'ContactsDataBase'
             }

Solution

  • {
           xtype: 'list',
           itemTpl: [
                       '<div id="wrapper">'+
                       '<div class="frt"><tpl if="Name != null">{Name}</tpl></div>'+
                       '<div class="frt"><tpl if="Title != null">{Title}</tpl></div>'+
                       '<div class="frt">{Contact}</div>'+
                       '<div class="frt">{Zip}</div>'+
                       '</div>'
                    ],
            store: 'ContactsDataBase'
    }
    

    Visit Sencha Touch docu site for more information.

    Cheers, Oleg