Hi,
There was another topic related to this issue but was very extended.
I was not able to use the other LOV examples so I´ve developed another.
My issue with the code below is because the standard LOV has thousands of records but only displayed 39 at a time. For more need to scroll down.
The objective when I select Return in Issue/return parts the bins shown are only the ones with existing stock and I´m selecting all bins and hide (tried to remove also) the ones that are not related in R5BONTSOCK.
But the problem is because I have thousands of records, the ones I need don´t be pull up.
Can you give any tip? I don´t know more what to do.
Below the code:
var vWOArray = [];
var table_L = '';
var table_R = '';
function buscarPartBin(){
var vFormPanel = EAM.Utils.getCurrentTab().getFormPanel();
vPartCode = vFormPanel.getFldValue('partcode');
vPartOrg = vFormPanel.getFldValue('storecode');
var vPartBin= EAM.Ajax.request({
url: "GRIDDATA",
params: {
SYSTEM_FUNCTION_NAME: "XU1055",
USER_FUNCTION_NAME: "XU1055",
CURRENT_TAB_NAME: "HDR",
COMPONENT_INFO_TYPE: "DATA_ONLY",
GRID_NAME: "XU1055",
MADDON_FILTER_ALIAS_NAME_1: "bis_part",
MADDON_FILTER_OPERATOR_1: "=",
MADDON_FILTER_JOINER_1: "AND",
MADDON_FILTER_SEQNUM_1: 1,
MADDON_FILTER_VALUE_1: vPartCode,
MADDON_FILTER_ALIAS_NAME_2: "bis_part_org",
MADDON_FILTER_OPERATOR_2: "=",
MADDON_FILTER_JOINER_2: "AND",
MADDON_FILTER_SEQNUM_2: 1,
MADDON_FILTER_VALUE_2: vPartOrg
}});
vgridResult = vPartBin.responseData.pageData.grid.GRIDRESULT.GRID.DATA.length;
for (var i = 0; i < vgridResult; i++) {
vWOArray[i] = vPartBin.responseData.pageData.grid.GRIDRESULT.GRID.DATA[i].bis_bin;
}
}
function borrarTablas(){
var tables = document.getElementsByTagName("table");
var numtables = tables.length;
var numbins = vWOArray.length;
buscarPartBin();
alert(vWOArray.length);
var counter = 1;
var counter2 = 0;
for(var j = 0; j < (numtables); j++){
var tableID = tables[j].getAttribute("id");
if (tableID.substring(0, 9)=="tableview"){
counter2++;
var cells = tables[j].getElementsByTagName("td");
var binvalue = cells[0].textContent;
if(counter>numbins){
var table = document.getElementById(tableID);
table.style.display='none';
}
}
counter++;
}
alert(counter2);
var tables = document.getElementsByTagName("table");
var numtables = tables.length;
for(var j=0; j<numtables;j++){
var tableID = tables[j].getAttribute("id");
if (tableID.substring(0, 9)=="tableview"){
var cells = tables[j].getElementsByTagName("td");
if(cells.length>0){
var binvalue = cells[0].textContent;
var pos1 = binvalue.indexOf("</div>");
if(pos1 > 0){
var k = pos1;
var salir="false";
while(salir=="false"){
if(binvalue.substring(k, (k+1)) == ">"){
table_L = binvalue.substring(0, (k+1));
table_R = binvalue.substring(pos1, binvalue.length);
salir="true";
}
;
k--;
if(k < 0){
salir="true";
}
}
}
var table = document.getElementById(tableID);
table.innerHTML = table_L+vWOArray[j]+table_R;
}
}
}
} //borrarTablas()
Ext.define('EAM.custom.external_SSISSU', {
extend: 'EAM.custom.AbstractExtensibleFramework',
getSelectors: function() {
return {
'[extensibleFramework] [tabName=HDR] lovfield[name=bincode]':{
beforetriggerclick : function () {
var vFormPanel = EAM.Utils.getCurrentTab().getFormPanel();
var vPartCode = vFormPanel.getFldValue('partcode');
alert('beforetriggerclick');
vFormPanel.getForm().findField('bincode').lookupLOV = {
lovName: 'LVRETURNBIN',
inputFields: {
'part_code': 'partcode',
'part_org': 'partorganization',
'store_code': 'storecode'
},
returnFields: {
'bincode': 'bincode'
},
clearFields: ['lotcode']
}
setTimeout(borrarTablas, 1000);
}
// end beforetriggerclick
}
// end
} // return
} // getSelectors
}); // Ext.define
Thanks in advance!
Rui