Re arranging the columns in Doors module/view, any ideas please?

Hello Everyone,

 

Is there any way I can re arrange the columns in a view, which I am creating dynamically using Skiplist. As this Skiplist is getting sorted and I am not able to get the columns as per my requirement.

Any ideas? Please help me, I appreciate your help.

 

-RvSaladi


RvSaladi - Fri Oct 10 10:42:53 EDT 2014

Re: Re arranging the columns in Doors module/view, any ideas please?
llandale - Fri Oct 10 14:17:01 EDT 2014

Not sure what you are after.  But if you use a "Column" handle of the "Key" of a skip list, I think you retrieve them from the skip in memory address order; whatever that is.  You can though use a "Sequencer" to keep them in the original order:

  • int Sequencer = 0
  • Skip skpColumns = create() // KEY 'int' Sequence; DATA 'Column' handle
  • Column c
  • string Title
  • for c in mod do
  • {  put(skpColumns, Sequencer++, c)
  • }
  • for c in skpColumns do
  • {  Sequencer = (int key skpColumns)
  •    Title = title(c)
  •     print Sequencer "\t" Title "\n"
  • }

I don't see a way to "move" a column like you can in the GUI.  But you could get all the "Column" characterits (title, attrName etc), delete that Column, then insert a new one and give it those characteristics.

-Louie

Re: Re arranging the columns in Doors module/view, any ideas please?
RvSaladi - Fri Oct 10 15:07:42 EDT 2014

llandale - Fri Oct 10 14:17:01 EDT 2014

Not sure what you are after.  But if you use a "Column" handle of the "Key" of a skip list, I think you retrieve them from the skip in memory address order; whatever that is.  You can though use a "Sequencer" to keep them in the original order:

  • int Sequencer = 0
  • Skip skpColumns = create() // KEY 'int' Sequence; DATA 'Column' handle
  • Column c
  • string Title
  • for c in mod do
  • {  put(skpColumns, Sequencer++, c)
  • }
  • for c in skpColumns do
  • {  Sequencer = (int key skpColumns)
  •    Title = title(c)
  •     print Sequencer "\t" Title "\n"
  • }

I don't see a way to "move" a column like you can in the GUI.  But you could get all the "Column" characterits (title, attrName etc), delete that Column, then insert a new one and give it those characteristics.

-Louie

Thank you Louie,

here is the code

{code}

            for str in aSkipList do {
                string s = (string key aSkipList)
                ad = create object type str attribute s
                tColumn = insert column colCount++;
                if(TestNameExpr s) main(tColumn)
                attribute(tColumn, s)
                width(tColumn, 100)  // Using pixels
                title(tColumn, s)

            }

{code}

aSkipList is a global which i am populating with some key values as attributes and types. I am trying to create the columns with same name as key.

But the issue is, when i try to create the column, the order is shufling and the columns are creating in different order what I am not indend to, I didnot see any option in reference to rearrange it. I am thinking to use Array rathar than skip list, as a second plan. Please let me know if any suggestion.

I really appreciate your time and response.

Thank you..

 

Re: Re arranging the columns in Doors module/view, any ideas please?
RvSaladi - Fri Oct 10 15:17:09 EDT 2014

RvSaladi - Fri Oct 10 15:07:42 EDT 2014

Thank you Louie,

here is the code

{code}

            for str in aSkipList do {
                string s = (string key aSkipList)
                ad = create object type str attribute s
                tColumn = insert column colCount++;
                if(TestNameExpr s) main(tColumn)
                attribute(tColumn, s)
                width(tColumn, 100)  // Using pixels
                title(tColumn, s)

            }

{code}

aSkipList is a global which i am populating with some key values as attributes and types. I am trying to create the columns with same name as key.

But the issue is, when i try to create the column, the order is shufling and the columns are creating in different order what I am not indend to, I didnot see any option in reference to rearrange it. I am thinking to use Array rathar than skip list, as a second plan. Please let me know if any suggestion.

I really appreciate your time and response.

Thank you..

 

Other thing I forgot to mention, I am trying to make my intented column as main with the below code

 if(TestNameExpr s) main(tColumn)
 

but its not working, no effect on the columns order