【发布时间】:2013-04-18 05:36:33
【问题描述】:
这可能是一个愚蠢的问题,但这里是。
我一直在 sencha touch 2 应用程序上关注 this tutorial。我对 Ext JS 很陌生,我不明白何时使用 square brackets : [ .. ] 或 curly brackets : { .. }。
Ext.define("NotesApp.view.NotesListContainer", {
extend: "Ext.Container",
config: {
items: [{
xtype: "toolbar",
docked: "top",
title: "My Notes",
items: [{
xtype: "spacer"
}, {
xtype: "button",
text: "New",
ui: "action",
id:"new-note-btn"
}]
}]
}
});
喜欢这里
html: [
'<img src="http://staging.sencha.com/img/sencha.png" />',
'<h1>Welcome to Sencha Touch</h1>',
"<p>You're creating the Getting Started app. This demonstrates how ",
"to use tabs, lists and forms to create a simple app</p>",
'<h2>Sencha Touch 2</h2>'
].join("")
在编码 sencha touch 时,谁能帮助我正确使用大括号和方括号?
为什么不直接使用大括号 { .. } 呢?为什么 ext js 必须使用 [ .. ] 和 { .. }?
【问题讨论】:
-
上一门基本的 javascript 课程可能对您来说很有趣。因为这些东西是非常基本和必不可少的。 nfriedly.com/techblog/2009/06/…
-
好吧,我做了 w3schools 基础课程...没有遇到这样的大括号..无论如何,感谢您的链接,我会通过它。在开始接触煎茶之前,我还应该讨论其他任何“基本”主题吗?
标签: extjs sencha-touch sencha-touch-2