PDA

View Full Version : how hide loadmask when list is loaded....



maulik
31 Jan 2011, 2:33 AM
hi...

i m new in sencha.. i want to know that how to hide loadmask when list is loaded.. i hv seen sencha api but u cant find the solution... so plz help me to hide the load mask... here is my code..

.html

function onDeviceReady()
{
// do your thing!
var mask = new Ext.LoadMask(Ext.getBody(), {msg: "Please Wait...", remove: true});
mask.show();

setTimeout("mask.hide()",1000);

}

and here is my javascript..

.js


Ext.setup({
tabletStartupScreen: 'images/tablet_startup.png',
phoneStartupScreen: 'images/phone_startup.png',
icon: 'images/icon.png',
glossOnIcon: false,
onReady: function()
{

Ext.regModel('Status', {
fields: ['linie','status']
});

dsStatus = new Ext.data.Store({autoLoad:true,

model : 'Status',
proxy: new Ext.data.HttpProxy({
url: 'url',
method: 'GET',
reader: new Ext.data.JsonReader({
totalProperty: 'totalCount',
id: 'linie',
root: 'result',
fields:['linie','status']
})
}),
success: function()
{
mask.hide();
},
listeners: {'load': function () {
dsStatus.each(function(r)
{

});
}

}
});

tpl = new Ext.XTemplate('<tpl for=".">',
'<tpl if="status == 1">{linie} <img src="images/icon.png" width="25px" height="25px"></tpl>',
'<tpl if="status == 2">{linie} <img src="images/red.jpg" width="25px" height="25px"></tpl>',
'<tpl if="status == 3">{linie} <img src="images/Add.png" width="25px" height="25px"></tpl>',
'</tpl>',
'<div class="x-clear"></div>'
);


var listStatus = new Ext.List({
fullscreen: true,
//itemTpl :'{linie} - {status}',
itemTpl : tpl,
indexBar: true,
//LoadMask:true,
store: dsStatus
});

var dockedList = [{
xtype: 'tabpanel',
dock: 'center',
fullscreen: true,
items:[{
title: 'Status',
html: '<p>test 1</p>',
LoadMask:true,
dockedItems:listStatus
}]
}]

var appPanel = new Ext.Panel({
id: 'appPanel',
fullscreen: true,
dockedItems: dockedList
});

}
});


plz help me... and thanx in advance...
i m waiting for your reply...
thanx...

AndreaCammarata
31 Jan 2011, 5:28 AM
Hi maulik.
To do what you request take a look at this thread.
http://www.sencha.com/forum/showthread.php?122017-showing-loader-while-loading-store&highlight=load+mask

Hope this helps.

jay@moduscreate.com
31 Jan 2011, 7:09 AM
Also, please wrap your code in [CODE] tags in the future.