craftleft.gif (3002 bytes)QuickTable
Home | API | Tutorial | Download | Support | Contact topblack.gif (108 bytes)


QuickTable User Cp  |  Register  |  Members  |  Search  |  Help
    |- QuickTable Discussion Forums > Column Post New Topic   Post A Reply
moveColumn() not working printer friendly version
next newest post | next oldest post
Author Messages
sandeep.bhatt
Private

Gender: Unspecified
Location:
Registered: Apr 2007
Status: Offline
Posts: 9

Click here to see the profile for sandeep.bhatt Send email to sandeep.bhatt Send private message to sandeep.bhatt Find more posts by sandeep.bhatt Edit or delete this message Reply w/Quote
Posted Thursday, May 3, 2007 @ 04:18:11  

Hi,

am trying to move columns based on saved user order from a file

This is how i set up my table:-

1. I insert the first row by refresh(vectorOfVectors)
2. Subsequent rows are created with insert(vector)
3. Then am trying to re-lay the columns according to the saved col order

heres the code:-

while(strtoken.hasMoreTokens() ) {

strcolname = strtoken.nextToken();
System.out.println("COL NAME:"+ strcolname);

odbtable.moveColumn
(odbtable.getColumnByHeaderName(strcolname).getModelIndex()-1,colindex);


System.out.println("COLUMN"+""+strcolname+"MOVED FROM INDEX"+""
+(odbtable.getColumnByHeaderName(strcolname).getModelIndex() - 1)+"TO INDEX"+colindex);

colindex++;



}

My print statement indicates that the columns have moved, But the table displays
the cols in the same original order.

Any idea why column move not working?

Thanx in advance

Admin
Board Owner

Gender: Unspecified
Location:
Registered: Jul 2003
Status: Offline
Posts: 9

Click here to see the profile for Admin Send email to Admin Send private message to Admin Find more posts by Admin Edit or delete this message Reply w/Quote
Posted Saturday, May 19, 2007 @ 01:33:40  

Please read carefully the api

Moves the source column to the position currently occupied by the
target column . The old column at <I>targetColumn</I> is
shifted left or right to make room.

Also, the column index starts from 0,1,2...

I tried moveColumn(1,0) and it worked, so it might be problem with the index you are passing to moveColumn

Post New Topic   Post A Reply Jump to:
Contact Us | QuickTable - A Java DBGrid | Privacy Policy All times are GMT -5 Hours.
Welcome to QuickTable Forums, Guest!  
Login
Username :
Password :
In order to fully utilize the abilities of this board, you are required to register as a member. Registration is free, and allows you to do lots of things including turning on or off certain features of this board. Register now!
Powered by CuteCast v2.0 BETA 2
Copyright © 2001-2003 ArtsCore Studios