I have been using the wonderful dxl script called LinkEditor (link_ed.dxl) for some time now. One of the things that I would like to do is be able to sort on the different columns, so to group all the in links together or sort by link module, etc. I've looked at the DXL help manual. This seems like it should be easy, but I haven't been able to figure out how to add sort functionality. Any help would be appreciated.
|
Re: Adding sort capabilities to LinkEditor (link_ed.dxl)
ListView yes?
//***************************************************
int fDbeLv_clbkSortFunction(string s1, s2)
{ // Standard sort function when defining a ListView column as sortable.
// Developers Note: Some code if added herein will cause DXL exception Violations.
// Don't understand why, but this function needs to be kept as-is.
int Result
if (s1 == s2) Result = 0
elseif (s1 > s2) Result = 1
elseif (s1 < s2) Result = -1
else{} // all cases covered
return(Result)
} // end fDbeLv_clbkSortFunction()
|
Re: Adding sort capabilities to LinkEditor (link_ed.dxl) llandale - Wed Oct 24 16:58:13 EDT 2012
ListView yes?
//***************************************************
int fDbeLv_clbkSortFunction(string s1, s2)
{ // Standard sort function when defining a ListView column as sortable.
// Developers Note: Some code if added herein will cause DXL exception Violations.
// Don't understand why, but this function needs to be kept as-is.
int Result
if (s1 == s2) Result = 0
elseif (s1 > s2) Result = 1
elseif (s1 < s2) Result = -1
else{} // all cases covered
return(Result)
} // end fDbeLv_clbkSortFunction()
I've attached the updated LinkEditor DXL. Here's another silly question: How would I update this script to add a second level sort order (e.g. sort by Module then by ID or sort by In/Out then by Object Heading/Text, etc.) Attachments attachment_14901662_LinkEditor-Sort.dxl |
Re: Adding sort capabilities to LinkEditor (link_ed.dxl) ZenMonkey760 - Wed Oct 24 17:30:33 EDT 2012 -Louie |
Re: Adding sort capabilities to LinkEditor (link_ed.dxl) I wrote a script that is based on "link_ed.dxl" I added additional features and additional data validation. It's still a work in progress but was wondering if anyone would have additional feature requests? If you note any logic error please let me know. Thank you. -Jim Attachments attachment_14958844_transferLinksAv_1_0A.dxl |
Re: Adding sort capabilities to LinkEditor (link_ed.dxl) ZenMonkey760 - Wed Oct 24 17:30:33 EDT 2012 First of all, thank you for all the hard work in making this script.
The one problem I am having with it is this: When I sort a column and then choose a link to revert, the script will not revert the link I have selected. Instead it is reverting the link that would have been in that position before I sorted the column, if that makes sense. I have no dxl background so I'm not sure what the issue is. This script would be perfect if this could be fixed though. Any ideas?
Thanks -Matt |
Re: Adding sort capabilities to LinkEditor (link_ed.dxl) m_estock - Thu Sep 05 17:50:12 EDT 2013 First of all, thank you for all the hard work in making this script.
The one problem I am having with it is this: When I sort a column and then choose a link to revert, the script will not revert the link I have selected. Instead it is reverting the link that would have been in that position before I sorted the column, if that makes sense. I have no dxl background so I'm not sure what the issue is. This script would be perfect if this could be fixed though. Any ideas?
Thanks -Matt Yes. You need to add another column to the listview, perhaps "Orginal Sequence" of type "int" perhaps column 5. Then in function "DoRevert" after current line 274 ("if (selected..)") then getColumnValue(5), and use variable instead of "index" in line 275. Sorry, don't have time to code this. -Louie |