Refreshing grid after xpath filtering not working anymore ?
Hi
I am encontering a strange regression bug moving to 2.1 to 2.5
I have an Extended grid i am using for a customer apllication.
I have built a custom header with drop down listing each distinct value in each column.
(the distinct sorting is done in the XML and the grid use xpath to separate the content of the rows, from the data to put in the filtering combo)
Using the drop down actually filter the grid combining xpath.
Much like Excel.
the whole grid aplication is prety much complex, but basicaly the filter logic is just:
- applaying an xpath to the the table object,
- then loading the whole xml (saved as a js var to be abled to keep the whole data after filtering so you can keep changing the filter)
- SetRow count to the grid and various text info in the footer.
- refreshing.
This used to work like a charm in 2.1, and quite fast.
Now in 2.5 the filtering do work but not the refresh, and i have to move the grid scrollbar so i actuallly see the change and the footer never refresh.
the grid.refresh() seams to take no time and have no effect.
I dont's see exctly what is going wrong and do need to upgrade for better Firefox 3 support.
Do you have any idear on what the problem could be ?
here is a very simplified (but still non working) part of the code involved :
Thanks for your help
I am encontering a strange regression bug moving to 2.1 to 2.5
I have an Extended grid i am using for a customer apllication.
I have built a custom header with drop down listing each distinct value in each column.
(the distinct sorting is done in the XML and the grid use xpath to separate the content of the rows, from the data to put in the filtering combo)
Using the drop down actually filter the grid combining xpath.
Much like Excel.
the whole grid aplication is prety much complex, but basicaly the filter logic is just:
- applaying an xpath to the the table object,
- then loading the whole xml (saved as a js var to be abled to keep the whole data after filtering so you can keep changing the filter)
- SetRow count to the grid and various text info in the footer.
- refreshing.
This used to work like a charm in 2.1, and quite fast.
Now in 2.5 the filtering do work but not the refresh, and i have to move the grid scrollbar so i actuallly see the change and the footer never refresh.
the grid.refresh() seams to take no time and have no effect.
I dont's see exctly what is going wrong and do need to upgrade for better Firefox 3 support.
Do you have any idear on what the problem could be ?
here is a very simplified (but still non working) part of the code involved :
var myGrid = new AW.Grid.Extended;
myGrid.setId("myGrid");
myGrid.setHeaderCount(2);
var myHeaders = ["Numero","Demande","Site","Domaine","Sous domaine/Famille","Elements","Statut","Etat","Date d'émission","Date de début","Date de fin","Durée"]
var myHeadersflt = ["", "", "", "", "", "", "", "", "", "", "", "", ""];
myGrid.setHeaderText(myHeaders, 0);
myGrid.setHeaderText(myHeadersflt, 1);
myGrid.setColumnCount(12);
var currentFilter = new Array();
function filter_grid() //revoir modele -> prototype de filtres
{
var strxpath = "";
if (currentFilter["demtypeCombo"]) {
strxpath += "dem/@eid=\"" + currentFilter["demtypeCombo"] + "\"";
}
table.setRows("//matrice/ligne["+ ((strxpath)?strxpath:"*") +"]");
table.setXML(wholeXML);
myGrid.setFooterText(["Total:", table.getCount() + " demandes",]);
myGrid.setRowCount(table.getCount());
myGrid.refresh();
}
var demtypeCombo = new AW.UI.Combo;
demtypeCombo.setControlText("filtre");
demtypeCombo.setItemText(["filtre"]);
demtypeCombo.setItemValue([""]);
demtypeCombo.setItemCount(1);
demtypeCombo.onItemClicked = function(event, i){
currentFilter["demtypeCombo"]=this.getItemValue(i);
filter_grid();
}
myGrid.setHeaderTemplate(demtypeCombo, 1, 1);
demtypeCombo.setAttribute("aw", "control"); // restore 'control' behavior
demtypeCombo.getPopupTemplate().setStyle("width", "100%");
var demtypeNomArr = new Array();demtypeNomArr[0]="Tous";
var demtypeIdArr = new Array();demtypeIdArr[0]=0;
var table = new AW.XML.Table;
myGrid.setCellModel(table);
myGrid.setVirtualMode(true); //Virtual Mode
table.setAsync(true);
table.setURL("/analyses_matrice_request.php?idx_commu=58&matid=&submit_tbl=1");
table.setRequestMethod("POST");
table.response = function(text) {
wholeXML = text;
table.setXML(text);
table.setRows("//matrice/demandes[*]");
table.setXML(text);
for (a=1,l=0; l<table.getCount();a++,l++ ) {
demtypeNomArr[a]=table.getData(1,l);
demtypeIdArr[a]=table.getData(0,l);
}
demtypeCombo.setItemText(demtypeNomArr);
demtypeCombo.setItemValue(demtypeIdArr);
demtypeCombo.setItemCount(table.getCount()+1);
table.setRows("//matrice/ligne[*]");
table.setXML(text);
myGrid.setFooterText(["Total:",table.getCount() + " demandes",]);
myGrid.setRowCount(table.getCount());
myGrid.refresh();
}
table.request();
myGrid.setFooterVisible(true);
document.write(myGrid);
Thanks for your help
Thomas Duquette
October 21,