Hi
I have a Grid used for data entry and 2 fields needs to do a lookup to Inventory.
With version 3.6 I used enableFilteringMode, which allowed us to lookup data for the combobox based on what they user typed in the combobox. This worked really well and kept the amount of data sent between server and client to a minimum.
The code for this is like this:
Note PNStockCombo and PNStockDescCombo.
PartsNeeded = new dhtmlXGridObject('PartsNeeded');
PartsNeeded.setEditable(true);
PartsNeeded.enableEditEvents(true,false,true);
PartsNeeded.setImagePath('codebase/imgs/');
PartsNeeded.setHeader('Part that need to be ordered (ENSURE YOU USE GREENTREE CODE),#cspan,#cspan,#cspan',null,["font-weight:bold;font-size:12px;","","",""]);PartsNeeded.attachHeader('Part No.,Description,Quantity,Narration',["text-align:left;","text-align:left;","text-align:right;","text-align:left;"]);PartsNeeded.setColAlign('left,left,right,left');
PartsNeeded.setColTypes('ed,ed,edn,ed');
PartsNeeded.setColSorting('str,str,str,str');
PartsNeeded.setInitWidths('110,250,80,300');
PartsNeeded.setColumnExcellType(0, "combo");
PartsNeeded.setColumnExcellType(1, "combo");
PartsNeeded.attachEvent("onEditCell", pnOnCellEdit);
PartsNeeded.submitSerialization(true);
PartsNeeded.init();
PartsNeeded.setSkin('dhx_skyblue');
PartsNeeded.i18n.decimal_separator=".";
PartsNeeded.i18n.group_separator=",";
PartsNeeded.attachEvent("onXLS",function(){ showProgress("prgPartsNeeded", "PartsNeeded"); });
PartsNeeded.attachEvent("onXLE",function(){ hideProgress("prgPartsNeeded"); });
PartsNeeded.loadXML('pagevrd.vrd?session=d48o0qdvj27aflrqptuwt0rzhfeatnhf&objectOid=10032.386844&page=vJobSheet&formAction=getData2');
PNStockCombo = PartsNeeded.getColumnCombo(0);
PNStockCombo.enableFilteringMode(true, "pagevrd.vrd?session=d48o0qdvj27aflrqptuwt0rzhfeatnhf&objectOid=10032.386844&page=vJobSheet&formAction=getStockCode", true, true);
PNStockDescCombo = PartsNeeded.getColumnCombo(1);
PNStockDescCombo.enableFilteringMode(true, "pagevrd.vrd?session=d48o0qdvj27aflrqptuwt0rzhfeatnhf&objectOid=10032.386844&page=vJobSheet&formAction=getStockDesc", true, true);
But since upgrading to 4.0.2 this is no longer working. To get the combo (PNStockCombo and PNStockDescCombo ) to work I needed to change my code to this:
Note PNStockCombo and PNStockDescCombo.
PartsNeeded = new dhtmlXGridObject('PartsNeeded');
PartsNeeded.setEditable(true);
PartsNeeded.enableEditEvents(true,false,true);
PartsNeeded.setImagePath('codebase/imgs/');
PartsNeeded.setHeader('Part that need to be ordered (ENSURE YOU USE GREENTREE CODE),#cspan,#cspan,#cspan',null,["font-weight:bold;font-size:12px;","","",""]);PartsNeeded.attachHeader('Part No.,Description,Quantity,Narration',["text-align:left;","text-align:left;","text-align:right;","text-align:left;"]);PartsNeeded.setColAlign('left,left,right,left');
PartsNeeded.setColTypes('ed,ed,edn,ed');
PartsNeeded.setColSorting('str,str,str,str');
PartsNeeded.setInitWidths('110,250,80,300');
PartsNeeded.setColumnExcellType(0, "combo");
PartsNeeded.setColumnExcellType(1, "combo");
PartsNeeded.attachEvent("onEditCell", pnOnCellEdit);
PartsNeeded.submitSerialization(true);
PartsNeeded.init();
PartsNeeded.setSkin('dhx_skyblue');
PartsNeeded.i18n.decimal_separator=".";
PartsNeeded.i18n.group_separator=",";
PartsNeeded.attachEvent("onXLS",function(){ showProgress("prgPartsNeeded", "PartsNeeded"); });
PartsNeeded.attachEvent("onXLE",function(){ hideProgress("prgPartsNeeded"); });
PartsNeeded.loadXML('pagevrd.vrd?session=d48o0qdvj27aflrqptuwt0rzhfeatnhf&objectOid=10032.386844&page=vJobSheet&formAction=getData2');
window.dhx4.ajax.method = "get";
PNStockCombo = PartsNeeded.getColumnCombo(0);
PNStockCombo.enableFilteringMode(true);
PNStockCombo.load('pagevrd.vrd?session=d48o0qdvj27aflrqptuwt0rzhfeatnhf&objectOid=10032.386844&page=vJobSheet&formAction=getStockCode');
PNStockDescCombo = PartsNeeded.getColumnCombo(1);
PUStockDescCombo.enableFilteringMode(true);
PNStockDescCombo.load('pagevrd.vrd?session=d48o0qdvj27aflrqptuwt0rzhfeatnhf&objectOid=10032.386844&page=vJobSheet&formAction=getStockDesc');
Note the difference is I needed to set the ajax method to “get”. Which is all good.
But the big difference is, I cannot use enableFilteringMode as I did with 3.6. Now the only way to get the combos to load the data is to load All the data using the load method.
This is an issue though because this causes the page to load All the data in the combobox vs the old method allowed us to only load data that was searched for and having thousands of Inventory it really is not a good way to do it.
With search I mean that when a user typed something in the combobox, with 3.6 and using enableFilteringMode with a url, it will call the url with every key pressed in the combo and then we could go and filter the data based on what was typed in. With 4.0.2 this doesn’t work because it is not doing a call to the url used in enableFilteringMode.
My question is how do I use enableFilteringMode with 4.0.2 as it worked with 3.6?
Also I am only including dhtmlx.js in my page. I tried to add dhtmlxgrid_excell_context.js to my page, but this is from 3.6 and I don’t believe it should be included. But this dit not solve my issue anyways.
Thanks