I'm having an issue with some functionality when I am refreshing some table data.
I basically have a page with 2 tables. One has line items and a link that the user can click to change the data in the second table to that particular line item. One of the columns in the 2nd table holds images that have a javascript image zooming utility attached to them.
The issue that I am having is that when I switch between the line items the zooming functionality does not work. It works fine on the initial load of the page, but once the user starts switching back and forth between the line items then it stops working.
Here is the function that I am calling...it basically calls a service to get the data and then updates the model. The data populates correctly, but the image zooming functionality does not work.
reviewItem:function(oEvent)
{
var oSelectedObj = oEvent.getSource().getBindingContext().getObject();
localStorage['equipmentNumber'] = oSelectedObj.EquipmentNumber;
localStorage['sequenceNumber'] = oSelectedObj.SeqNo;
//oController.updateEvents(oSelectedObj.EquipmentNumber, oSelectedObj.SeqNo);
var equipMasterDetailSvcUrl = urlObj.photoReview_details_service;
var equipMasterDetailSvcReqData = {"equipMasterDetail":{"equipNumber": oSelectedObj.EquipmentNumber, "seqNumber": oSelectedObj.SeqNo}} ;
var equipMasterDetailResData = getAjaxData(equipMasterDetailSvcUrl, 'POST', equipMasterDetailSvcReqData, false);
if(equipMasterDetailResData.error){
}
else
{
if(equipMasterDetailResData.d.results != 'undefined')
{
aData = equipMasterDetailResData.d.results;
//Create a model and bind the table rows to this model
aData.unshift({Information: "DAMAGE NOT EVIDENT", ImageSourceThumb: "", checked: false, visible: false});
aData.push({Information: "FIRST DAMAGE OCCURRENCE NOT SEEN", ImageSourceThumb: "", checked: false, visible: false});
for(var i = 0; i < aData.length; i++)
{
if(aData[i].GateType == "RR")
{
aData[i].visible = false;
}
}
var wqTable = sap.ui.getCore().getControl("wqtable");
oModel.setData({modelData: aData});
oModel.refresh(true);
wqTable.setVisibleRowCount(aData.length);
wqTable.addDelegate({
onAfterRendering: function(){
$('.image-constraint').elevateZoom({scrollZoom: true, zoomWindowPosition: 2, zoomWindowOffetx: 10});
}
});
//wqTable.bindRows("/modelData");
}
}
}
I have also attached the full view and controller code.