thanks for this lovely framework.
i wanna hug the whole community 
(yes, is my first post)
I havent any deadline since im coding for food in php outside of website environments, but i love to play at weekends with Ext toys.
I had fun while writing some class at ux namespace, but while extending DataView, i faced one badlookin workaround. It does the expected work, but im expecting too that it can be done in other (better) way.
When i extend Ext.DataView, i override the default store/tpl and my wish is to call some method of this extension when user click some tag inside the tpl markup.
As pasted below, i call this method by using a poor workaround (bold), and i need also another poor workaround to remember/call the id of each item of tpl in order to show/hide them (underline).
It works, but i feel link a noob.
Im wondering about creating the markup elements inside the onRender event, and handle them easy, also, then im able to work with Ext.util.ClickRepeater to add functionality to the buttons rather than a ugly strict onclick.
I dont do it yet cos i think that this simple extension of DataView is enough, less than for this little issue xD
My question is, how can be improved this piece of code?
Code:
Ext.ux.Weather = Ext.extend(Ext.DataView, {
initComponent:function() {
Ext.apply(this, {
store: new Ext.data.Store({
autoLoad:false,
url: location.pathname,
baseParams:{
'Call': 'clsLOGWeather'
},
reader: new Ext.data.JsonReader({
root: 'data',
totalProperty: 'total',
id: 'date'
},[
{name: 'seed', mapping: 'seed'},
{name: 'date'}, {name: 'icon'}, {name: 'text'}, {name: 'temp'},
{name: 'hi'}, {name: 'lo'}, {name: 'humi'}, {name: 'wind'}
])
}),
tpl: new Ext.XTemplate(
'<tpl for=".">'
+'<table id="w{seed}{[xindex]}" class="{[xindex > 1 ? "x-hidden" : ""]}" cellspacing="0" width="100%">'
+'<tr height="21">'
+'<td class="x-date-left">'
+'<tpl if="xindex > 1">'
+'<a href="javascript:void();" onclick="Ext.ux.Weather.prototype.movePage(\'w{seed}{[xindex]}\',\'w{seed}{[xindex-1]}\');"> </a>'
+'</tpl>'
+'</td>'
+'<td class="x-date-middle" align="center">'
+'{date}'
+'</td>'
+'<td class="x-date-right">'
+'<tpl if="xindex < 10">'
+'<a href="javascript:void();" onclick="Ext.ux.Weather.prototype.movePage(\'w{seed}{[xindex]}\',\'w{seed}{[xindex+1]}\');"> </a>'
+'</tpl>'
+'</td>'
+'</tr>'
+'<tr>'
+'<td colspan="3">'
+'<table cellspacing="0">'
+'<tr>'
+'<td width="52" style="padding-left:6px;">'
+'<img ext:qtip="{text}" src="http://image.weather.com/web/common/wxicons/52/{icon}.gif"border="0" height="52" width="52">'
+'</td>'
+'<td style="padding-left:4px;">'
+'<tpl if="xindex < 2">'
+'<div ext:qtip="{text}">Temperatura: <b ext:qtip="{text}">{temp}</b></div>'
+'</tpl>'
+'<tpl if="xindex > 1">'
+'<div ext:qtip="{text}">Max: <b ext:qtip="{text}">{hi}</b> Min:<b ext:qtip="{text}">{lo}</b></div>'
+'</tpl>'
+'<div ext:qtip="{text}"><b ext:qtip="{text}" style="float:right">{humi}</b>Humitat:</div>'
+'<div ext:qtip="{text}"><b ext:qtip="{text}" style="float:right">{wind}</b>Vent:</div>'
+'</td>'
+'</tr>'
+'</table>'
+'</td>'
+'</tr>'
+'</table>'
+'</tpl>'
),
style:'margin-bottom:10px;margin-top:10px;border:1px #9ACD68 solid;background-color:#F6F6F6;',
height:75
});
Ext.ux.Weather.superclass.initComponent.call(this);
},
onRender:function(ct, pos) {
var myStore = this.store;
new Ext.util.TaskRunner().start({
run: function() {
myStore.reload();
},
interval: 21*60*1000
});
Ext.ux.Weather.superclass.onRender.call(this, ct, pos);
},
movePage: function(h,s) {
Ext.get(h).addClass('x-hidden');
Ext.get(s).removeClass('x-hidden');
}
});
Ext.reg('uxweather', Ext.ux.Weather);
As curiosity the store point to:
[php]
$XML = new SimpleXMLElement(file_get_contents(
"http://xoap.weather.com/weather/local/SPXX0015?cc=*&unit=m&dayf=10"
));
$data[] = array(
"seed" => uSeed ,
"date" => "Barcelona ".date("H:ia") ,
"text" => "{$XML->cc->t}" ,
"temp" => "{$XML->cc->tmp}