Commit b7061824 authored by Adrien PARROT's avatar Adrien PARROT
Browse files

change searchPage : sap.ui.table.Table -> sap.m.Table

parent ae3a5cda
......@@ -281,6 +281,8 @@ sap.ui.jsview("conceptmapper.conceptDetailPage", {
});
var oTable = new sap.m.Table({
fixedLayout:false,
growing: true,
growingThreshold: 10,
//growingScrollToLoad : true,
......@@ -410,14 +412,17 @@ sap.ui.jsview("conceptmapper.conceptDetailPage", {
title : "{i18n>app_head}",
showSubHeader : true,
subHeader : oSubHeader,
headerContent : [ new sap.m.Button({
// text:"lol",
icon : "sap-icon://sys-help"
}),
headerContent : [
// new sap.m.Button({
// // text:"lol",
// icon : "sap-icon://sys-help"
// }),
new sap.m.Button({
text: '{loginModel>/m_username}',
icon : "sap-icon://employee",
enabled:false, /// to change
press: [ oController.userInfos, oController ],
}),
new sap.m.Button({
......
......@@ -137,48 +137,48 @@ sap.ui.jsview("conceptmapper.mapperPage", {
new sap.m.IconTabFilter({
iconColor: sap.ui.core.IconColor.Critical,
text: "Algorithms",
icon: "sap-icon://developer-settings",
key: "key3",
// count: "233",
content: [
new sap.m.ToggleButton({
id: "algo1Toggle",
pressed: true,
text: "Algo 1",
icon : "sap-icon://radar-chart",
press : [ oController.algo_one, oController ],
}),
new sap.m.ToggleButton({
id: "algo2Toggle",
pressed: false,
text: "Algo 2",
icon : "sap-icon://radar-chart",
press : [ oController.algo_two, oController ],
}),
new sap.m.ToggleButton({
id: "algo3Toggle",
pressed: false,
text: "Algo 3",
icon : "sap-icon://radar-chart",
press : [ oController.algo_three, oController ],
}),
]
}),
// new sap.m.IconTabFilter({
// iconColor: sap.ui.core.IconColor.Critical,
// text: "Algorithms",
// icon: "sap-icon://developer-settings",
//
//
// key: "key3",
//// count: "233",
// content: [
//
//
// new sap.m.ToggleButton({
// id: "algo1Toggle",
// pressed: true,
// text: "Algo 1",
// icon : "sap-icon://radar-chart",
// press : [ oController.algo_one, oController ],
//
// }),
//
// new sap.m.ToggleButton({
// id: "algo2Toggle",
// pressed: false,
// text: "Algo 2",
// icon : "sap-icon://radar-chart",
// press : [ oController.algo_two, oController ],
//
// }),
//
// new sap.m.ToggleButton({
// id: "algo3Toggle",
// pressed: false,
// text: "Algo 3",
// icon : "sap-icon://radar-chart",
// press : [ oController.algo_three, oController ],
//
// }),
//
//
// ]
// }),
//
new sap.m.IconTabFilter({
iconColor: sap.ui.core.IconColor.Positive,
......@@ -328,6 +328,8 @@ sap.ui.jsview("conceptmapper.mapperPage", {
var oConceptsdetailList = new sap.m.Table({
fixedLayout:false,
// growing: true,
// growingThreshold: 10,
//growingScrollToLoad : true,
......@@ -498,6 +500,8 @@ sap.ui.jsview("conceptmapper.mapperPage", {
var oTable = new sap.m.Table({
growing: true,
fixedLayout:false,
growingThreshold: 10,
//growingScrollToLoad : true,
//footerText : "Static table footer text",
......@@ -626,14 +630,17 @@ sap.ui.jsview("conceptmapper.mapperPage", {
navButtonPress : function(oEvt) {
app.back();
},
headerContent : [ new sap.m.Button({
// text:"lol",
icon : "sap-icon://sys-help"
}),
headerContent : [
// new sap.m.Button({
// // text:"lol",
// icon : "sap-icon://sys-help"
// }),
new sap.m.Button({
text: '{loginModel>/m_username}',
icon : "sap-icon://employee",
enabled:false, /// to change
press: [ oController.userInfos, oController ],
}),
new sap.m.Button({
......
......@@ -94,9 +94,9 @@ function getConceptsAjax(oData, oTable_ref) {
},
success: function(data) {
if (oData.limit) {
oTable_ref.setVisibleRowCount(oData.limit);
}
// if (oData.limit) {
// oTable_ref.setVisibleRowCount(oData.limit);
// }
console.log("data from getConceptsAjax");
......@@ -439,8 +439,11 @@ sap.ui.controller("conceptmapper.searchPage", {
goToConceptDetail : function (oEvt) {
debugger;
var sVal = oEvt.getParameters().rowBindingContext.getProperty('concept_id');
var sVal = oEvt.getSource().getAggregation('cells')[1].getProperty('text');
debugger;
// GET AJAX call on concept
getConceptDetailAjax(sVal);
......@@ -455,9 +458,20 @@ sap.ui.controller("conceptmapper.searchPage", {
var URL_concept = "http://omop-mapper.fgh.ovh/api/concept/";
var URL_concept = "http://127.0.0.1:5000/concept/";
debugger;
//oTable_ref.getAggregation('items')[i].getAggregation('cells')[0].getProperty('selected')
var idx = []
var oTable_ref = sap.ui.getCore().byId('oTable');
idx = oTable_ref.getSelectedIndices();
for (var i in oTable_ref.getAggregation('items')) {
if (oTable_ref.getAggregation('items')[i].getAggregation('cells')[0].getProperty('selected')) {
idx.push(i);
}
}
// idx = oTable_ref.getSelectedIndices();
if (idx.length === 0) {
sap.m.MessageToast.show("No item to map!");
return;
......@@ -474,13 +488,16 @@ sap.ui.controller("conceptmapper.searchPage", {
for (var i in idx) {
var domain_id = oTable_ref.getRows()[idx[i]].getCells()[7].getProperty('text');
// var domain_id = oTable_ref.getRows()[idx[i]].getCells()[7].getProperty('text');
// oDomainMCB_list.indexOf(domain_id) === -1 ? oDomainMCB_list.push(domain_id):console.log("This item already exists");
var domain_id = oTable_ref.getAggregation('items')[idx[i]].getAggregation('cells')[8].getProperty('text');
oDomainMCB_list.indexOf(domain_id) === -1 ? oDomainMCB_list.push(domain_id):console.log("This item already exists");
$.ajax({
type:"GET",
url: URL_concept + oTable_ref.getRows()[idx[i]].getCells()[0].getProperty('text'),
url: URL_concept + oTable_ref.getAggregation('items')[idx[i]].getAggregation('cells')[1].getProperty('text'),
dataType:"json",
async: false,
header: {
......
......@@ -176,8 +176,8 @@ sap.ui.jsview("conceptmapper.searchPage", {
var oTable = new sap.ui.table.Table({
id : "oTable",
visibleRowCount: 15,
// id : "oTable",
//visibleRowCount: 15,
cellClick : [ oController.goToConceptDetail, oController ],
rowSettingsTemplate: new sap.ui.table.RowSettings({
highlight:"{conceptsModel>status}"
......@@ -196,6 +196,7 @@ sap.ui.jsview("conceptmapper.searchPage", {
width : '7%',
}));
oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
text : "{i18n>concept_name}"
......@@ -221,6 +222,7 @@ sap.ui.jsview("conceptmapper.searchPage", {
}));
oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
text : "{i18n>concept_class_id}"
......@@ -264,6 +266,8 @@ sap.ui.jsview("conceptmapper.searchPage", {
}));
oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
text : "{i18n>validity}"
......@@ -298,6 +302,243 @@ sap.ui.jsview("conceptmapper.searchPage", {
path : "conceptsModel>/docs",
});
var aColumns = [
new sap.m.Column({
header : new sap.m.Label({
text : "To map"
})
}),
new sap.m.Column({
header : new sap.m.Label({
text : "{i18n>concept_id}"
}),
// width:"40%",
}),
new sap.m.Column({
header : new sap.m.Label({
text : "{i18n>concept_name}"
}),
// width : '60%',
}),
new sap.m.Column({
header : new sap.m.Label({
text : "{i18n>concept_code}"
})
}),
new sap.m.Column({
header : new sap.m.Label({
text : "{i18n>concept_class_id}"
})
}),
new sap.m.Column({
header : new sap.m.Text({
text : "{i18n>vocabulary_id}"
}),
}),
new sap.m.Column({
header : new sap.m.Label({
text : "{i18n>standard_concept}"
}),
}),
new sap.m.Column({
header : new sap.m.Label({
text : "{i18n>validity}"
}),
}),
new sap.m.Column({
header : new sap.m.Label({
text : "{i18n>domain_id}"
}),
}),
];
var selectedItems = []
var oTemplate = new sap.m.ColumnListItem({
//vAlign: "Middle",
//type : sap.m.ListType.Active,
type: "Active",
press : [ oController.goToConceptDetail, oController ],
cells : [
new sap.m.CheckBox({
//
}),
new sap.m.Text({
text : "{conceptsModel>concept_id}",
wrapping : true,
}),
new sap.m.FormattedText({
htmlText : "{conceptsModel>concept_name}",
wrapping : true
}),
new sap.m.Text({
text : "{conceptsModel>concept_code}",
wrapping : true
}),
new sap.m.Text({
text : "{conceptsModel>concept_class_id}",
wrapping : true
}),
new sap.m.Text({
text : "{conceptsModel>standard_concept}",
wrapping : true
}),
new sap.m.Text({
text : "{conceptsModel>vocabulary_id}",
wrapping : true
}),
new sap.m.Text({
text : "{conceptsModel>invalid_reason}",
wrapping : true
}),
new sap.m.Text({
text : "{conceptsModel>domain_id}",
wrapping : true
}),
]
});
// var oItemTemplateRelation = new sap.ui.core.Item({
// key : "{relationsModel>key}",
// text : "{relationsModel>text}",
// enabled : "{relationsModel>enabled}"
// });
// var oRelationMapperMCB = new sap.m.ComboBox({
// id : "oRelationMapperMCB",
// width : "10%",
// enabled: false,
//
// placeholder : "relationship",
// items : {
// path : "relationsModel>/items",
// template : oItemTemplateRelation
// },
// selectedKey : {
// path : "relationsModel>/selected",
// template : "{relationsModel>selected}"
// }
// });
// var oTableHeader = new sap.m.Toolbar({
// content : [
//// new sap.m.Title({
//// text : "Choose a relation concept and click on the concept to map"
//// }),
// //new sap.m.ToolbarSpacer(),
// new sap.m.Label({
// text:"Choose the relation"
// }),
//
// oRelationMapperMCB,
// ]
// });
var oTable = new sap.m.Table({
id : "oTable",
fixedLayout:false,
//growing: true,
//growingThreshold: 10,
//growingScrollToLoad : true,
//footerText : "Static table footer text",
// headerToolbar : oTableHeader,
//infoToolbar : oTableInfo,
// swipeContent : oSwipe,
columns : aColumns,
// selectionChange : function(e) {
// sap.m.MessageToast.show("selection is changed");
// },
// "delete" : function(oEvent) {
// var oItem = oEvent.getParameter("listItem");
// sap.m.MessageBox.confirm("Are you sure to delete this record?", {
// onClose: function(sResult){
// if (sResult == sap.m.MessageBox.Action.CANCEL) {
// return;
// }
// oTable.removeItem(oItem);
// setTimeout(function() {
// oTable.focus();
// }, 0);
// }
// });
// },
//itemPress : [ oController.mapper, oController ],
// itemPress : function(e) {
// sap.m.MessageToast.show("item is pressed");
// debugger;
// },
// paste: applyPastedData
});
oTable.bindItems({
//path: "conceptsMapperModel>/docs",
path : "conceptsModel>/docs",
template : oTemplate,
key: "id"
});
......@@ -414,13 +655,14 @@ sap.ui.jsview("conceptmapper.searchPage", {
press: [ oController.usersParams, oController ],
}),
new sap.m.Button({
// text:"lol",
icon : "sap-icon://sys-help"
}),
// new sap.m.Button({
// // text:"lol",
// icon : "sap-icon://sys-help"
// }),
new sap.m.Button({
id: 'registrationSearch',
icon : "sap-icon://employee",
type: "Accept",
press: [ oController.userAuthentification, oController ],
}),
......@@ -428,6 +670,7 @@ sap.ui.jsview("conceptmapper.searchPage", {
id: 'loginSearch',
text: '{loginModel>/m_username}',
icon : "sap-icon://employee",
enabled:false, /// to change
visible: false,
press: [ oController.userInfos, oController ],
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment