projects
/
evergreen
/
masslnc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
38de535
)
Reporter: Sort contents of remote selector widgets
author
Thomas Berezansky
<tsbere@mvlc.org>
Wed, 3 Oct 2012 19:25:53 +0000
(15:25 -0400)
committer
Ben Shum
<bshum@biblio.org>
Thu, 28 Feb 2013 14:29:47 +0000
(09:29 -0500)
Simple sort based on the display value.
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/web/reports/oils_rpt_widget.js
patch
|
blob
|
history
diff --git
a/Open-ILS/web/reports/oils_rpt_widget.js
b/Open-ILS/web/reports/oils_rpt_widget.js
index
7e644ec
..
28123d2
100644
(file)
--- a/
Open-ILS/web/reports/oils_rpt_widget.js
+++ b/
Open-ILS/web/reports/oils_rpt_widget.js
@@
-523,6
+523,14
@@
oilsRptRemoteWidget.prototype.draw = function() {
}
oilsRptRemoteWidget.prototype.render = function(objs) {
+ var selector = this.field.selector;
+ objs.sort(
+ function(a,b){
+ if (a[selector]() > b[selector]())
+ return 1;
+ else
+ return -1;
+ });
for( var i = 0; i < objs.length; i++ ) {
var obj = objs[i];
var label = obj[this.field.selector]();