1
実行時に作成されるボタンを表示するには、アプリが必要です。その理由は、私が必要とするボタンの数を見るためにサービスから情報を得ることになるからです。実行時にEnyoでボタンを作成するにはどうすればよいですか?
現在、プログラムは実行されていますが、ボタンは表示されません。
私は、ツールバーを使用して、作成機能でコントロールプロパティを設定しようとしています。プログラムは正常に実行されますが、ツールバーにはボタンがありません。これを行う方法はありますか?
コード:
// Trying to create buttons at run time
name: "MyApps.MainApp",
kind: enyo.VFlexBox,
components: [
{kind: "PageHeader", content: "Template"},
{kind: "Toolbar", name: "tabsted"},
{name: "feedUrl", kind: "Input", flex: 1},
{kind: "HtmlContent", name: "comments", content: "hello world <br> and another lin"},
{name:"curValue", content:("Sample Text \r\n and more")},
{kind: "Button", caption: "Action", onclick: "btnClick"},
],
// this gets called first ha
create: function()
{
this.inherited(arguments);
this.$.tabsted.components= [
{caption: "a"},
{caption: "b"},
{caption: "c"}
];
this.LoadCommments();
},
LoadCommments: function()
{
this.$.comments.content="fred";
},
// called when button is clicked
btnClick: function()
{
this.$.curValue.setContent("Put some text here"); // handle the button click
}
};
こんにちは、私は冷たくないenyoコンポーネントのAPIドキュメント、私はhttps://developer.palm.com/content/api/index.htmlに行った、あなたは私にリンクを与えることができる –
このリンクを試してください:https ://developer.palm.com/content/api/reference/enyo/enyo-api-reference.html#enyo.Componentしかし、SDKのインストールディレクトリにあるドキュメントは、動的作成に関してさらに詳しく説明しています。 – Pre101
私は、この回答を編集して所有者オブジェクトを適切に設定するようにしました。あなたの他の質問からもわかるように、私はこれを残しました。 – Pre101