我有一张表有很多数据.现在我想垂直滚动表头固定.我可以做到这一点吗?
这是我的代码:
onInit: function() {
var data = new JSONModel("Model/data.json");
this.getView().setModel(data);
var otable = this.getView().byId("PlaceIt");
otable.bindItems("/employees", new ColumnListItem({
cells: [
new Text({
text: "{name}"
}),
new Text({
text: "{Physics}"
}),
new Text({
text: "{Chemistry}"
}),
new Text({
text: "{Maths}"
}),
new Text({
text: "{English}"
})
]
}));
otable.setModel(data);
var oScrollContainer = new ScrollContainer({
height: "100px",
vertical: true,
focusable: true,
content: [oTableItems]
});
},
Run Code Online (Sandbox Code Playgroud)
<Table id="PlaceIt">
<columns>
<Column>
<Text text="Student Name" />
</Column>
<Column>
<Text text="Physics" />
</Column>
<Column>
<Text text="Chemistry" …
Run Code Online (Sandbox Code Playgroud) 所以我试图调用function
从another function
.并且它们都在同一个内部定义Controller
.但到目前为止我尝试过的一切都是"funtion is not defined"
最好的.如何正确地做这件事?
angular.module('App')
.controller('Controller', ['$http', '$scope', function($http, $scope) {
this.getSomething1 = function() {};
this.getSomething2 = function() {
if (1 == 1) {
getSomething1();
}
};
}]);
Run Code Online (Sandbox Code Playgroud)
ReferenceError:未定义getSomething1