Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!
btn.placeAt(...). Их подход предлолагает манипулирование DOM-элементами из кода, как в jQuery?<div>
<my-button caption="Click me" ng-click="..." other-property="..." />
</div>
new sap.ui.commons.Button("MyButton", {text:"Hello JS View"});
<Button id="MyButton" text="Hello XML View"/>
{
"Type":"sap.ui.commons.Button",
"id":"MyButton",
"text":"Press Me"
}
this.getView().byId("MyButton")
sap.ui.getCore().byId("MyButton")
this.getView().createId("MyButton")
If you want to define IDs for controls inside a JSView to guarantee their uniqueness when reusing views, you can not give hardcoded IDs, but have to give the view the opportunity to add its own instance ID as a prefix. This is done by using the View.createId(...) method. For the example above, this is done as follows:
var oButton = new sap.ui.commons.Button(this.createId("myButton"), {text:"Hello JS View"});
This is not required for declarative view types as the view parser can manage this automatically
dojo на порядок круче, богаче, модульнее, продуманнее. документация и примеры в сравнение не идут.
OpenUI5 – новый javascript фреймворк от SAP