![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: ListView Issues Topic Summary: ListView Issues Created On: 9-Feb-2006 20:43 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
I'm finally plowing into using List Views DBEs for the first time, intending to write a good Baseline a bunch of modules script.
I'm learning a lot and writing utility functions to help deal with them. I'm stuck right now, I cannot figure out how to sort a column. I see the two sort functions (setting the callback and declaring when to sort), but Its not working. Selecting the column in the List View doesn't do anything. Thought? - Louie |
|
![]() |
|
![]() |
|
Louie,
A long time ago I was attempting the same. After a little work, I finally got a callback to fire when you clicked on any column of the listView, however no matter which column was clicked, it would only sort on column 0, effectively making the call useless for sorting. (See attached example) I solved my case by creating a choice element that contains the names of the columns. Changing the value of the choice element triggers a callback to change the column sorting. The callback is a separate function that reads the list, empties it, and puts it back sorted in the desired order. Yes it's a kludge, but at least I can sort. If you do figure it out, I would be interested in the solution. There's a particular script just waiting for this... -Dennis Edited: 9-Feb-2006 at 21:38 by Dennis Lockshine |
|
![]() |
|
![]() |
|
You just need to add the sort option in the declaration of the listView as follows:
listDBE=listView(box, listViewOptionSortText, 320, 5, nullList) As an aside, I wanted to toggle between ascending and descending if the column is clicked on again. Unfortunately when I try to use the perm getSortColumn(DBE) it causes DOORS to crash. ------------------------- Tony Goodman http://www.smartdxl.com |
|
![]() |
|
![]() |
|
Hi Louie,
as Dennis already mentioned, I never had success on this topic too. The functions described in DXL reference manual never worked correctly! So the only possibility is to do the sorting yourself : Therefore I would suggest to you to held the information of listview in an Array and create Skip lists as indexes to it. The Skips will be sorted automatically (if you use information of this column as key ![]() A long time ago, I tried to create my own list view to solve this problem, but I didn't had enough time to finish with that ![]() @Tony : Did this solution really worked well? Usually the sort function does only work well for first column. Greetings Reik ------------------------- Evosoft GmbH for Siemens Industry Sector Berlin, Germany |
|
![]() |
|
![]() |
|
Tony,
Nice job. Modifying that one line allows the listView to be sorted on the column that is selected. Thanks! I also saw that using the perms getSortColumn() or setSortColumn() inside the function dxlSortFn() would crash DOORS and produce an EXCEPTION_ACCESS_VIOLATION. Using those two perms anywhere else in the script would work as expected. It seems like when a column heading is clicked on to change the sort, it puts the listView DBE into an unstable state. -Dennis |
|
![]() |
|
![]() |
|
The sort function fires often when you click on a column header in such a manner that it looks like a bubble sort algorithm to me, but the input parameters are blank strings so nothing sorts. I've already put the function: fListViewDropEvent in the create DBE statement. It fires when you click and drag. I don't know what to put in that function to make sorting work.
Yes, the getSortColumn() function causes exception violations. I think I've got the other stuff figured out, library functions to do such things as inserting a column with values, replacing the values in the columns, etc. - Louie |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
ListView Issues
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.