Author: jfthomps
Date: Tue Mar 10 16:15:41 2015
New Revision: 1665605

URL: http://svn.apache.org/r1665605
Log:
VCL-776 - rework resource code to have a base class for all resources and 
inheriting classes for each resource type

computer.js: modified initPage and refreshcompdata: set comparatorMap for 
fields procnumber, procspeed, network, and ram so they will sort in numerical 
order instead of string order

Modified:
    vcl/trunk/web/js/resources/computer.js

Modified: vcl/trunk/web/js/resources/computer.js
URL: 
http://svn.apache.org/viewvc/vcl/trunk/web/js/resources/computer.js?rev=1665605&r1=1665604&r2=1665605&view=diff
==============================================================================
--- vcl/trunk/web/js/resources/computer.js (original)
+++ vcl/trunk/web/js/resources/computer.js Tue Mar 10 16:15:41 2015
@@ -283,6 +283,14 @@ function initPage() {
                        dijit.byId('newnathostbtn').set('disabled', true);
 
                clearTimeout(filterdelay);
+
+               if(! resourcestore.comparatorMap) {
+                       resourcestore.comparatorMap = {};
+               }
+               resourcestore.comparatorMap['ram'] = resource.nocasesort;
+               resourcestore.comparatorMap['procnumber'] = resource.nocasesort;
+               resourcestore.comparatorMap['procspeed'] = resource.nocasesort;
+               resourcestore.comparatorMap['network'] = resource.nocasesort;
        }
 }
 
@@ -1179,7 +1187,11 @@ function refreshcompdata(refreshcount) {
        var url = resourcestore.url;
        resourcestore.close();
        resourcestore = new dojo.data.ItemFileWriteStore({url: url});
-       resourcestore.comparatorMap = {name: resource.nocasesort};
+       resourcestore.comparatorMap = {name: resource.nocasesort,
+                                      procnumber: resource.nocasesort,
+                                      procspeed: resource.nocasesort,
+                                      network: resource.nocasesort,
+                                      ram: resource.nocasesort};
        resourcestore.fetch();
        savescroll = resourcegrid.scrollTop;
        resourcegrid.setStore(resourcestore, resourcegrid.query);


Reply via email to