:: Forum >>

Sorting is not working properly.

Hi all,
Grid sorting is not giving correct output. when we click on column head it reveses its order but not sort it. Is this a known problem?
Does anyone know how to fix it?

Thanks,
Sandesh
Sandesh Dube
Monday, December 11, 2006
Please post an example
D
Monday, December 11, 2006
Here is the code. following method "printCertified()" recieves bean array from java class. This method first converts bean array into multiD array, then sets images for column 3 and 5 and after that it write grid object on document. I am very new to Active Widgets, I may go wrong at very basic level too. Any type of help will appriciated.

function printCertified(options)
{
var i=0;
    optionList1 = new Array();
    for (var data in options)
     {
list=new Array();
list[0]=options[data].requestId;
list[1]=options[data].externalRef;
list[2]=options[data].statusName;
list[3]=options[data].regFlag;
list[4]=options[data].regLevel;
list[5]=options[data].priorety;
list[6]=options[data].mntFlag;
list[7]=options[data].productLine;
list[8]=options[data].version;
list[9]=options[data].product;
list[10]=options[data].labstract;
list[11]=options[data].owner;
list[12]=options[data].objectiveDate;
list[13]=options[data].modificationDate;
list[14]=options[data].activity;
list[15]=options[data].level1;
list[16]=options[data].customer;
optionList1[i]=list;
i=i+1;
}
    var header=["RequestID", "Num", "Status", "Reg", "Reg Level", "Sevirety", "Mgnt", "Product Line", "Version", "Product", "Abstract", "Owner", "ObjectiveDate", "ModificationDate","Activity","Level1","Customer"];
        

var obj = new AW.Grid.Extended;
        obj.setSize(990,350);
        obj.setHeaderText(header);
        obj.setColumnCount(17);
        obj.setRowCount(i);
        
// enable row selectors
        obj.setSelectorVisible(true);
        obj.setSelectorText(function(i){return this.getRowPosition(i)+1});
        if(i>999)
         obj.setSelectorWidth(40);
        else
            obj.setSelectorWidth(25);
        
// set row selection
        obj.setSelectionMode("single-row");

            //setting image for priorety
        obj.setCellData(function(col, row){return col + "." + row});
        function image(col, row){
if (this.getCellText(5, row) == "1") {
return "p1";
}
else if (this.getCellText(5, row) == "2") {
return "p2";
}
else if (this.getCellText(5, row) == "3") {
return "p3";
}
else if (this.getCellText(5, row) == "4") {
return "p4";
}
}
    obj.setCellTemplate(new AW.Templates.Image, 5);
obj.setCellImage(image, 5);

//setting image for regression
        obj.setCellData(function(col, row){return col + "." + row});
    function imageReg(col, row){
if (this.getCellText(3, row) == "1") {
return "reg";
}
else
return;
}
obj.setCellTemplate(new AW.Templates.Image, 3);
obj.setCellImage(imageReg, 3);

//open case on double click
obj.onCellDoubleClicked = function(event, column, row){
if(column==1)
window.open( 'Case?requestid='+this.getCellText(0,row), '', 'width=300,height=200,top=120,left=120,menubar=1, toolbar=1, resizable=1, scrollbars=1, status=1' );
};

//setting list of cases
    obj.setCellText(optionList1);
    document.write(obj);

Sandesh Dube
Tuesday, December 12, 2006
If I remove code of images then it is working fine.
Does anyone know how to use images in grid in a way that would not affect sorting of grids?

Thanks,
Sandesh
Sandesh Dube
Wednesday, December 13, 2006

This topic is archived.


Back to support forum

Forum search