0
如何从数据库中获取记录。我有500条记录我想要获取200条记录,并且在用户按下超过我想获取另外200条记录的数据库之后...我有像下面这样做,但我只得到200记录,如果我,如果我不使用顶部= 200..then让所有记录使用top = 200 .. ..获取一定数量的记录,并在表中显示
var url = "/sap/opu/odata/sap/ZODATA_CRUD_OPR_SRV/";
//Service Url
var oModel1 = new sap.ui.model.odata.ODataModel(url);
var oUrlParams = "$top=" + '200' + "&$skip=" +'0' ;
oModel1.read("/EmpDetails1Set", null,oUrlParams,true, function(oData){ //read method
oODataJSONModel.setData(oData);
that.getView().setModel(oODataJSONModel,"emp");
},
function(error) {
});
<Table id="table" width="auto" growingScrollToLoad="false" growingThreshold="100" items="{emp>/results}" growing="true">
<columns>
<Column id="nameColumn">
<Text text="" id="nameColnTitle"/>
</Column>
<Column id="namolumn">
<Text text="" id="nameCumnTitle"/>
</Column>
</columns>
<items>
<ColumnListItem type="Navigation" press="onPress">
<cells>
<Text id="ob" text="{emp>Name}"/>
<Text text="{emp>Address}"/>
</cells>
</ColumnListItem>
</items>
</Table>
谢谢苏尼尔...... – user1862322
谢谢苏尼尔...如果我做这样的我只得到200条......之后,我按下“更多”,那么其余的项目都无法加载。 – user1862322