Opened 13 years ago

Closed 13 years ago

#2016 closed defect (fixed)

FilteringTable.js

Reported by: ahansen1@… Owned by: Tom Trenka
Priority: high Milestone: 0.9
Component: Widgets Version: 0.4
Keywords: Cc:
Blocked By: Blocking:

Description

The FilteringTable? checkin on 6713 looks for the sortFunction on the field but it is currently contained on the meta. I'm not sure if the sortFunction should be moved to the field, or if it is prefered to have the createSortFunction look for it on the meta. In either case, they must be in sync.

Change History (6)

comment:1 Changed 13 years ago by alex

Milestone: 0.5

comment:2 Changed 13 years ago by Tom Trenka

Resolution: invalid
Status: newclosed

Please, please, please take a closer look on the code before filing bugs that have poor descriptions. The meta object is created and the parseColumn methods mix values into each meta object.

This bug is invalid.

comment:3 Changed 13 years ago by guest

Resolution: invalid
Status: closedreopened

I appreciate your quick response. I did dig through the code before submitting the bug. I had assumed that coupled with the checkin number of the change that the description of the problem was appropriate. However based on your response it appears I assumed incorrectly. Let me elaborate on the problem that I'm seeing. These are the steps I've taken:

Updated the test_FilteringTable.html in attempt to use this functionality. I did the following:

Custom JS Function:

<script>
	function testSort() {
		alert("custom sort will compare and return appropriately");
		return 0;
	}
</script>

Attach Sort Function:

<th field="Name" dataType="String" sortusing="testSort" valign="top">Name</th>

With the above changes the testSort function is not called using revision 6713 of FilteringTable?.js. However, after modifying the createSorter function in FilteringTable?.js

From:

if(field.sortFunction!=null){
	var ret = field.sortFunction(a, b);
...

To:

if(meta.sortFunction!=null){
	var ret = meta.sortFunction(a, b);
...

The functionality worked as expected. I wasn't able to find an example in the current code base so I may be incorrectly using this feature. This may still be an invalid bug. But, I'm re-opening it in case expanding on initial poor explanation helps point out a real problem. Thanks and sorry for the inconvenience in the event that it's still invalid.

comment:4 Changed 13 years ago by Tom Trenka

Resolution: fixed
Status: reopenedclosed

(In [6740]) Fixes #2016.

comment:5 Changed 13 years ago by guest

Resolution: fixed
Status: closedreopened

Attempted to sync with check-in 6740 however the test case listed above still does not work. The change made to FilteringTable.js was:

if(meta.sortFunction!=null){
	var ret = field.sortFunction(a, b);

However, I think it should have been (calling sortFunction on meta):

if(meta.sortFunction!=null){
	var ret = meta.sortFunction(a, b);

comment:6 Changed 13 years ago by Tom Trenka

Resolution: fixed
Status: reopenedclosed

(In [6807]) Fixes #2016.

Note: See TracTickets for help on using tickets.