gpt4 book ai didi

extjs - extJs门户内的extJs gmappanel

转载 作者:行者123 更新时间:2023-12-04 13:42:21 25 4
gpt4 key购买 nike

我想在extJs门户中使用extJS Gmappanel。以下是样本extJS门户。在“google” portlet内,我需要拥有Google map 。

我们如何在extJs门户中创建extJs gmappanel?

Ext.define('Ext.app.Portal', {
extend: 'Ext.container.Viewport',
uses: ['Ext.app.PortalPanel', 'Ext.app.PortalColumn', 'Ext.app.GridPortlet', 'Ext.app.ChartPortlet'],
getTools: function() {
return [{
xtype: 'tool',
type: 'gear',
handler: function(e, target, panelHeader, tool) {
var portlet = panelHeader.ownerCt;
portlet.setLoading('Working...');
Ext.defer(function() {
portlet.setLoading(false);
}, 2000);
}
}];
},

initComponent: function() {
var content = '<div class="portlet-content">' + Ext.example.shortBogusMarkup + '</div>';
Ext.apply(this, {
id: 'app-viewport',
layout: {
type: 'border',
padding: '0 5 5 5'
},
items: [{
id: 'app-header',
xtype: 'box',
region: 'north',
height: 70,
html: 'Dimestore Reports'
}, {
xtype: 'container',
region: 'center',
layout: 'border',
items: [{
id: 'app-portal',
xtype: 'portalpanel',
region: 'center',
items: [

{
id: 'col-1',
items: [{
id: 'portlet-1',
title: 'google',
tools: this.getTools(),
items: {}, //I want ExtJs Form here.
listeners: {
'close': Ext.bind(this.onPortletClose, this)
}
},
{
id: 'portlet-2',
title: 'grid',
tools: this.getTools(),
html: content,
listeners: {
'close': Ext.bind(this.onPortletClose, this)
}
}
]
}
]
}]
}]
});
this.callParent(arguments);
},
onPortletClose: function(portlet) {
this.showMsg('"' + portlet.title + '" was removed');
},
showMsg: function(msg) {
var el = Ext.get('app-msg'),
msgId = Ext.id();
this.msgId = msgId;
el.update(msg).show();
Ext.defer(this.clearMsg, 3000, this, [msgId]);
},
clearMsg: function(msgId) {
if (msgId === this.msgId) {
Ext.get('app-msg').hide();
}
}
});

请帮忙

谢谢

最佳答案

我得到了答案

我只是将gmap放在库中的Ext.ux.GMapPanel中,并创建一个gmappanel

Ext.create('Ext.ux.GMapPanel', {
autoShow: true,
layout: 'fit',
closeAction: 'hide',
height: 300,
border: false,
items: {
xtype: 'gmappanel',
center: {
geoCodeAddr: 'pune,maharashtra',
marker: {
title: 'Pune'
}
},

}
});

使用上面的代码

谢谢

关于extjs - extJs门户内的extJs gmappanel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10482094/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com