[英]jquery in sapui5 xml
Is there a way to put jquery into controller which is working for example with $(document).ready(function(){}). 有没有一种方法可以将jquery放入与$(document).ready(function(){})配合使用的控制器中。 I know i can use some jquery in controller function, but it works only if someone click it. 我知道我可以在控制器功能中使用一些jquery,但是只有当有人单击它时它才起作用。 Where should i put jquery which is waiting for user, not for function setup. 我应该在哪里等待用户而不是功能设置的jquery。 Im working on xml. 我正在处理xml。 Ty guys. 伙计们。
fe controller: fe控制器:
sap.ui.define([
"ecu/controller/BaseController",
"sap/ui/model/odata/ODataModel",
"sap/ui/core/Fragment"
], function (BaseController, Fragment) {
"use strict";
return BaseController.extend("ecu.controller.Floor", {
onInit: function () {
},
someFunction: function (oEvent) {
console.log("something");
},
});
}); });
You can write your code inside Life cycle hook methods to automatically trigger your jQuery statements. 您可以在生命周期挂钩方法中编写代码,以自动触发jQuery语句。 Like you do inside
$(document).ready(function(){})
就像您在$(document).ready(function(){})
所做的一样
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.