Opened 14 years ago
Closed 14 years ago
#2037 closed enhancement (wontfix)
[patch] [need CLA] value sort on FilteringTable
Reported by: | Owned by: | Tom Trenka | |
---|---|---|---|
Priority: | high | Milestone: | 0.9 |
Component: | Widgets | Version: | 0.4.1rc1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
I made it so you can sort on the value attribute of a cell rather then the contents if you set the dataType to "value".
Here are the changes I made to FilteringTable?.js:
replace line 374 with:
if(sortType.toLowerCase()=="value"){
o.sortType = "value"; always convert to "value"
}else if(sortType.toLowerCase()=="html"
replace lines 652 - 653 with:
if(meta.sortType=="value") {
var a = parseInt(dojo.html.getAttribute(rowA.cells[fieldIndex],"value")); var b = parseInt(dojo.html.getAttribute(rowB.cells[fieldIndex],"value"));
} else {
var a = self.store.getField(self.getDataByRow(rowA), field); var b = self.store.getField(self.getDataByRow(rowB), field);
}
I have 2 comments about these changes. First, the way this is coded value must be a number. Second, you can still use the "sortusing" attribute to create a custom sort method to sort on the value (as an int).
Change History (5)
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
Milestone: | 0.4.1 → 0.5 |
---|
first, can you file this as a patch? Secondly, have you sent in a CLA?
comment:3 Changed 14 years ago by
where do I file this as a patch? Secondly, what is a CLA and where do I send it?
comment:4 Changed 14 years ago by
Owner: | changed from bill to Tom Trenka |
---|---|
Summary: | value sort on FilteringTable → [patch] [need CLA] value sort on FilteringTable |
CLA is http://www.dojotoolkit.org/icla.txt
Patch is a diff file format, which you can generate from eclipse or tortoiseSvn or (i thin) the command is called "patch" or maybe "svn patch". I don't use the command line.
comment:5 Changed 14 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
This may work for someone but I did not provide for this by design. If you are looking to sort by the keyField of each object, you can always add this code to your own versions--but I don't think it's appropriate here.
A quicker fix would be to simply display the keyField as one of your columns and allow someone to sort on that.
I forgot to mention that those line numbers were against the last nightly build (11/28/06) that I downloaded this morning.