Get/remember user column reordering?

Is it possible in tableview, with web client, to remember and restore the column drags that the user has made, between sessions?

Thanks,
Don

Hi Don,

It should be possible to request the ‘x’ value of an element.
This means you have to name every element you put on a tableview.
Then sort the x values and you have the column order.

So far I only used this in smart-client, but I assume this should work in the same way for web-client.

Hi Marc,

Do you mean I can store an array of “x” values in a field for the user’s preference table, and then restore it when the (structure/static) form is displayed…this will change the column order?

Thank you,
Don

Yes that should be possible.

Hi Marc,

I tried but did not meet with success. I used this to collect the original column order:

if(firstShow) {
     // obtaining default column order
	for (i = 0; i < elements.allnames.length; i++) {  
		elemName = elements.allnames[i]
		aStudentColNameDflt.push(elemName);
		aStudentColXDflt.push(elements[elemName].getLocationX());
	}	
}

I then dragged columns around, and clicked on a column header (as a quick test button) to see if I could restore the original order:

//restoring column order --
for (i = 0; i < aStudentColNameDflt.length; i++) { 
     y = elements[aStudentColNameDflt[i]].getLocationY();
     elements[aStudentColNameDflt[i]].setLocation(aStudentColXDflt[i],y);
}
application.updateUI();

When I trace, I can see that the original “x” values and column names are there. However, the setLocation doesn’t appear to be restoring the original column order.

Is this how you would approach it? (I’m using 6.0 point 8.)

Thank you,
Don

Hi Don,

currently working in 6.1.2, but this approach is working for me.
I don’t think there should be any difference between 6.0.8 and 6.1.2

The only thing might be your y position.
Basically the actual value doesn’t matter and you could all elements at the same y (as long as the y value is within your body part)