Commit 4d89ea392e125745b0b1848af6ebb6acd0509009

  • avatar
  • Sergey 'Jin' Bostandzhyan <jin @deve…per.digitalstrom.org>
  • Mon Jul 05 23:11:33 CEST 2010
  • Tree SHA1: 40a2dcf
  • Parent SHA1: 595dec6 (Merge commit 'refs/merge-requests/58' of git://gitorious.digitalstrom.org/dss-websrc/dss-websrc-mainline into integration)
  • raw diff | raw patch
Added button that toggles zone list sorting

The button cycles between the following sort modes:

sorting by zone id, ascending
sorting by zone id, descending
sorting by zone name, ascending
sorting by zone name, descending

references #400
dss-setup-interface/dSS/ZonePanel.js
(35 / 1)
  
1414
1515 this.tbar = this.buildTopToolbar();
1616
17 this.zoneSortMode = 0;
18
1719 dSS.ZonePanel.superclass.initComponent.apply(this, arguments);
1820 },
1921
3232 handler: this.editZone,
3333 scope: this
3434 },
35
3536 '->',
3637 {
38 iconCls: 'sortZoneAction',
39 handler: this.sortZonesCycle,
40 scope: this
41 },
42
43 {
3744 cls: 'zonePanelMenu',
3845 menu: [{
3946 text: _("Reload"),
157157 },
158158 reload: function() {
159159 this.ownerCt.loadData();
160 }
160 },
161 sortZonesCycle: function() {
162 var zstore = dSS.data.Loader.getZoneStore();
163 switch (this.zoneSortMode)
164 {
165 case 0:
166 zstore.sort('id', 'ASC');
167 this.zoneSortMode++;
168 break;
169 case 1:
170 zstore.sort('id', 'DESC')
171 this.zoneSortMode++;
172 break;
173 case 2:
174 zstore.sort('name', 'ASC');
175 this.zoneSortMode++;
176 break;
177 case 3:
178 zstore.sort('name', 'DESC');
179 this.zoneSortMode = 0;
180 break;
181 default:
182 this.zoneSortMode = 0;
183 break;
184 }
185 }
161186});
162187
163188Ext.reg('dsszonepanel', dSS.ZonePanel);