Javascript ExtJS 5:SyntaxError:应为表达式,使用Ext.panel.panel获得“}”
我使用ExtJS 5.0.1创建了一个简单的面板,但不起作用。每次我得到错误SyntaxError:expected expression,get'}'Javascript ExtJS 5:SyntaxError:应为表达式,使用Ext.panel.panel获得“}”,javascript,extjs,extjs5,Javascript,Extjs,Extjs5,我使用ExtJS 5.0.1创建了一个简单的面板,但不起作用。每次我得到错误SyntaxError:expected expression,get'}' 试试这样的 panel = new Ext.panel.Panel({ id:'ventana', autoScroll:true, height: altura, width: anchura, title: '&n
试试这样的
panel = new Ext.panel.Panel({
id:'ventana',
autoScroll:true,
height: altura,
width: anchura,
title: ' <bean:message key="breadcrumbs.gestionInventarios.consultaMultiple" />',
iconCls:'vDependencias',
layout: 'border',
closable: false,
renderTo: 'contenedor',
resizable: false,
items: [variabl1,variabl2 ],
frame: true
});
这可能是问题的根本原因
另外,请确保声明了altura和anchura变量,并且此面板仅出现错误
var panel= Ext.create('Ext.panel.Panel', {
id:'ventana',
autoScroll:true,
height: altura,
width: anchura,
title: ' <bean:message key="breadcrumbs.gestionInventarios.consultaMultiple" />',
iconCls:'vDependencias',
layout: 'border',
closable: false,
renderTo: 'contenedor',
resizable: false,
items: [{some type},{some type}],
frame: true
});
否则,您的构造就没有问题。什么是itemshere?嗨,我在主题中添加了anchura和altura变量。在我的代码中,items:的对象将是一个formPanel和另一个Panel,但现在我只使用两个字符串。我尝试使用你的代码,但仍然出现相同的错误。将你的另一个formPanel分配到变量中,并使用它,就像我更新了答案一样。谢谢,现在它似乎可以工作了。我无法在我的div中渲染它,但这是另一个问题。
var panel= Ext.create('Ext.panel.Panel', {
id:'ventana',
autoScroll:true,
height: altura,
width: anchura,
title: ' <bean:message key="breadcrumbs.gestionInventarios.consultaMultiple" />',
iconCls:'vDependencias',
layout: 'border',
closable: false,
renderTo: 'contenedor',
resizable: false,
items: [{some type},{some type}],
frame: true
});
items:[
{xtype:'button'},
{xtype:'textfield'}
]