From c5497d56185e5a3295b9b780a90ef8aea96edbf1 Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Sat, 29 Aug 2009 15:34:17 +0200 Subject: [PATCH] add sorting --- pyweb/mumble/views.py | 2 +- template/mumble/mumble.htm | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pyweb/mumble/views.py b/pyweb/mumble/views.py index f0e6224..e6493e8 100644 --- a/pyweb/mumble/views.py +++ b/pyweb/mumble/views.py @@ -232,7 +232,7 @@ def users( request, server ): def djangousers( request ): "Return a list of all Django users' names and IDs." users = [ { 'uid': '', 'uname': '------' } ]; - for du in User.objects.all(): + for du in User.objects.all().order_by( 'username' ): users.append( { 'uid': du.id, 'uname': unicode( du ), diff --git a/template/mumble/mumble.htm b/template/mumble/mumble.htm index aa0f73e..4f99d71 100644 --- a/template/mumble/mumble.htm +++ b/template/mumble/mumble.htm @@ -149,7 +149,7 @@ { name: 'id', type: 'int' }, { name: 'name', type: 'string' }, { name: 'password', type: 'string' }, - { name: 'owner', type: 'int' }, + { name: 'owner', type: 'int' }, { name: 'admin', type: 'bool' }, { name: 'delete', type: 'bool' }, ]); @@ -161,6 +161,7 @@ fields: userRecord, }), autoLoad: true, + remoteSort: false, }); adminColumn = new Ext.grid.CheckColumn({ @@ -222,6 +223,7 @@ cm: new Ext.grid.ColumnModel( [ { header: '{% trans "name" %}', dataIndex: 'name', + sortable: true, editor: new Ext.form.TextField({ allowBlank: false, }), @@ -229,6 +231,7 @@ header: '{% trans "Account owner" %}', dataIndex: 'owner', editor: ownerCombo, + sortable: true, renderer: function( value ){ if( value == '' ) return ''; items = ownerCombo.store.data.items;