3.2.0

Sorting files and directories

Hi,
I'm using the grid widget and I think is fantastic.
I use it to list and display files and folder (with the filesystem object in asp), but I have a problem.
When in my root folder there are some directories and I sort the items in my grid (e.g. by name) The folders are not listed at the top.

E.g.
I have the following items:
text1.txt: TEXT file
try1.pdf: PDF file
check1.doc: Word Document
mfolder: Folder

If I sort by name the items I get the following result:
check1.doc
mfolder
text1.txt
try1.pdf

How can I discriminate files and folders?

thanks
Seba
March 22,
You can provide functions for both 'data/text' and 'data/value' properties. The first one will be used for display and the second for sorting.
Alex (ActiveWidgets)
March 22,
Could you please show me azn example?
Seba
March 23,
obj.setDataText(function(i, j){return myData[i][j]});

function mySortValues(i, j){
if (myData[i][j].match("ADR")) {
return "1" + myData[i][j]
}
else {
return "2" + myData[i][j];
}
}

obj.setDataValue(mySortValues);

In this example if you sort on company name - ADRs will come on top.
Alex (ActiveWidgets)
March 23,
Great! Thanks so much.
Seba
March 24,

This topic is archived.

See also:


Back to support forum