Code:
var MyClientInfo;var tabpanel;
var mapdemo;
function UpdateLatesActions(res)
{
var MyLogs = res.value;
var MyHTML = "Test Add HTML";
document.getElementById("TblContainer").innerHTML = MyHTML;
}
function initialize() {
var position = new google.maps.LatLng(26.23122,50.51097);
var marker = new google.maps.Marker({
position: position,
title : 'Sencha HQ'
});
mapdemo.map.panTo(position);
//marker.setMap(mapdemo);
//mapdemo.maps.addOverlay(marker);
}
Ext.application({
name: 'MyApp',
launch: function() {
var tabpanel = Ext.create('Ext.tab.Panel', {
fullscreen : true,
items : [
{
title : 'One',
html : 'one'
},
{
title : 'Two',
html : 'two'
}
]
});
var panel = tabpanel.getComponent(1),
index = tabpanel.getItems().indexOf(panel),
tabBar = tabpanel.getTabBar(),
item = tabBar.getItems().getAt(index);
console.log(item);
}
});
This is my code, and it is NOT working:
Code:
var MyClientInfo;var tabpanel;
var mapdemo;
function UpdateLatesActions(res)
{
var MyLogs = res.value;
var MyHTML = "Test Add HTML";
document.getElementById("TblContainer").innerHTML = MyHTML;
}
function initialize() {
var position = new google.maps.LatLng(26.23122,50.51097);
var marker = new google.maps.Marker({
position: position,
title : 'Sencha HQ'
});
mapdemo.map.panTo(position);
//marker.setMap(mapdemo);
//mapdemo.maps.addOverlay(marker);
}
Ext.application({
name: 'MyApp',
launch: function() {
var position = new google.maps.LatLng(37.44885,-122.158592);
infowindow = new google.maps.InfoWindow({
content: 'Sencha Touch HQ'
});
mapdemo = new Ext.Map({
mapOptions : {
center : new google.maps.LatLng(37.381592, -122.135672), //nearby San Fran
zoom : 12,
mapTypeId : google.maps.MapTypeId.ROADMAP,
navigationControl: true,
navigationControlOptions: {
style: google.maps.NavigationControlStyle.DEFAULT
}
},
listeners : {
maprender : function(comp, map){
var marker = new google.maps.Marker({
position: position,
title : 'Sencha HQ',
map: map
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map, marker);
});
setTimeout( function(){ map.panTo (position); } , 1000);
}
}
});
tabpanel = Ext.create("Ext.tab.Panel", {
xtype:'tabpanel',
id: 'tabpanel',
fullscreen: true,
tabBarPosition: 'bottom',
items: [
{
title: 'Home',
iconCls: 'MyHome',
scroll: 'vertical',
html: [ "My HTML 1" ],
dockedItems: [{
xtype: "toolbar",
docked: 'top',
items: [
{
xtype: "spacer",
},
{
xtype: "button",
text: "Refresh",
handler: function () {
// function
}
}
]
}]
},
{
xtype: 'list',
title: 'Snapshot',
iconCls: 'Snapshot',
itemTpl: "<b>{title}:</b> {desc}",
store: {
fields: ['title', 'desc'],
data: [
{title: 'Name', desc: "Sencha Name"},
{title: 'Email', desc: "Sencha Email"},
{title: 'Mobile 1', desc: "Sencha Mobile 1"},
{title: 'Mobile 2', desc: "Sencha Mobile 2"}
]
}
},
{
title: 'History',
iconCls: 'History',
html: [ "My HTML 2" ].join("")
},
{
id: 'ViolationsTab',
title: 'Violations',
iconCls: 'Violations',
scroll: 'vertical',
badgeText: "5",
html: [ "<div id='TblContainerV'>My HTML 3</div>" ],
dockedItems: [{
xtype: "toolbar",
docked: 'top',
items: [
{
xtype: "spacer",
},
{
xtype: "button",
text: "Refresh",
handler: function () {
//Ext.Msg.alert('Alert', 'Violations Refresh', Ext.emptyFn);
}
}
]
}]
},
{
title: 'Map',
iconCls: 'Map',
layout: 'fit',
items: [mapdemo],
dockedItems: [{
xtype: "toolbar",
docked: 'top',
items: [
{
xtype: "spacer",
},
{
xtype: "button",
text: "Refresh",
handler: function () {
//Ext.Msg.alert('Alert', 'Violations Refresh', Ext.emptyFn);
//initialize();
}
}
]
}]
}
]
}).setActiveItem(0);
var panel = tabpanel.getComponent(0),
index = tabpanel.getItems().indexOf(panel),
tabBar = tabpanel.getTabBar(),
item = tabBar.getItems().getAt(index);
console.log(item);
}
});
What is the problem?