DarrenF
[WD12] Move row up or down in a browsing table control March 08, 2009 12:39AM |
No Name Amount Date 1 aaaaaaaaaa 11.11 01/01/09 2 bbbbbbbbbb 22.22 02/02/09 3 cccccccccc 33.33 03/03/09 4 dddddddddd 44.44 04/04/09If row 3 is currently selected and the 'Move Up' button is pressed, then rows 3 & 2 are effectively being transposed, so row 3 is placed into row 2 and row 2 is moved down to row 3 - is there a way of easily transposing these rows or do I need to defined individual variables (1 per column) to temporarily contain the data of the row I'm moving? ...or is there another (easier) way that you guys use that I can't see in the help files?
Jimbo
Re: [WD12] Move row up or down in a browsing table control March 08, 2009 12:57AM |
Moderator |
DarrenF
Re: [WD12] Move row up or down in a browsing table control March 08, 2009 02:34AM |
David Egan
Re: [WD12] Move row up or down in a browsing table control March 08, 2009 05:59AM |
PROCEDURE SwapLines_(_sTable,_iDirection = -1 ) li_currentrow is int = TableSelect({_sTable,indControl}) + _iDirection ls_templine is string IF li_currentrow > 1 THEN ls_templine = {_sTable,indControl}[{_sTable,indControl}] TableDelete({_sTable,indControl}) TableInsert({_sTable,indControl},ls_templine,li_currentrow) TableSelectPlus({_sTable,indControl},li_currentrow) ENDHTH
Louis Verbraak
Re: [WD12] Move row up or down in a browsing table control March 09, 2009 08:27AM |
marcel.berman@managingbusiness.be.pcs
Re: [WD12] Move row up or down in a browsing table control March 09, 2009 09:04AM |
DarrenF
Re: [WD12] Move row up or down in a browsing table control March 09, 2009 02:54PM |
DarrenF
Re: [WD12] Move row up or down in a browsing table control March 19, 2009 02:00AM |
// Locate the currently selected row glocaliRowSubscript1 is int = TableSelect(WTABLE_Spec_Sheet_Item) // If we are at the top of the TABLE, then we can't MOVE UP any further IF glocaliRowSubscript1 < 2 THEN RETURN END // Select the row above the one selected by the user ready for the swap TableSelectPlus(WTABLE_Spec_Sheet_Item,glocaliRowSubscript1 - 1) // Locate the other currently selected row glocaliRowSubscript2 is int = TableSelect(WTABLE_Spec_Sheet_Item) // Update - move row up HReadSeek(Spec_Sheet_Item,ID,WTABLE_Spec_Sheet_Item.WTABLECOL_ID[glocaliRowSubscript1]) Spec_Sheet_Item.nSequence = WTABLE_Spec_Sheet_Item.WTABLECOL_NSeq[glocaliRowSubscript2] HModify(Spec_Sheet_Item) // Update - move row down HReadSeek(Spec_Sheet_Item,ID,WTABLE_Spec_Sheet_Item.WTABLECOL_ID[glocaliRowSubscript2]) Spec_Sheet_Item.nSequence = WTABLE_Spec_Sheet_Item.WTABLECOL_NSeq[glocaliRowSubscript1] HModify(Spec_Sheet_Item) // Refresh the table TableDisplay(WTABLE_Spec_Sheet_Item) // Select/highlight the row that was moved up in the table TableSelectPlus(WTABLE_Spec_Sheet_Item,glocaliRowSubscript2)
Stefan Bentvelsen
Re: [WD12] Move row up or down in a browsing table control March 19, 2009 11:43AM |
DarrenF
Re: [WD12] Move row up or down in a browsing table control March 19, 2009 04:31PM |