ฉันได้กำหนดค่า manifest.json
& neo-app.json
แล้ว
"dataSources": {
,"news": {
"uri": "/destinations/int_news/sap/opu/odata/sap/XKDNK/",
"type": "OData",
"settings": {
"odataVersion": "2.0"
}
}
},
"models": {
"news": {
"dataSource": "news"
}
}
การดึงข้อมูล oData ในคอนโทรลเลอร์ของฉัน:
var oModel = this.getModel("news");
oModel.read("/planSet", {
success: function(data){
debugger;
}
});
แต่มันดึงข้อมูลทั้งหมดมากกว่า 1,000 แถว ฉันจำเป็นต้องเพิ่มตัวกรองลงในแบบสอบถาม
ฉันจัดการเพื่อเพิ่มตัวกรองเฉพาะใน URL โดยตรง:
$filter=SystemId eq \"SKYPE\"
แต่ฉันจะเพิ่มตัวกรอง JavaScript แบบไดนามิกโดยไม่ต้องดึงข้อมูลทั้งหมดได้อย่างไร ตัวอย่างเช่น:
var oModel = this.getModel("news");
oModel.read("/planSet?$filter" + <MY_CUSTOM_DATA_FILTER>, {
success: function(data){
debugger;
}
});