From c27efc4c1c282114c3399228be5dc5c9d02a4d17 Mon Sep 17 00:00:00 2001 From: Shaoquan Chen Date: Mon, 16 Mar 2015 17:07:51 -0700 Subject: [PATCH] [Launch Instance Fix] Add Sorting To Table in Select Source Change-Id: I8fd351d412750fc472d9821d8c835a96856e31ad Closes-Bug: 1432880 --- .../launch-instance/source/source.html | 24 ++++++++++++------- .../launch-instance/source/source.js | 20 ++++++++-------- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/openstack_dashboard/static/dashboard/launch-instance/source/source.html b/openstack_dashboard/static/dashboard/launch-instance/source/source.html index 35c5133600..bf25adb39d 100644 --- a/openstack_dashboard/static/dashboard/launch-instance/source/source.html +++ b/openstack_dashboard/static/dashboard/launch-instance/source/source.html @@ -234,20 +234,28 @@ - + {$ tableHeadCells[0].text $} - + {$ tableHeadCells[1].text $} - + {$ tableHeadCells[2].text $} - + {$ tableHeadCells[3].text $} diff --git a/openstack_dashboard/static/dashboard/launch-instance/source/source.js b/openstack_dashboard/static/dashboard/launch-instance/source/source.js index 3b036c30df..2033fbf41d 100644 --- a/openstack_dashboard/static/dashboard/launch-instance/source/source.js +++ b/openstack_dashboard/static/dashboard/launch-instance/source/source.js @@ -91,25 +91,25 @@ var tableHeadCellsMap = { image: [ - { text: gettext('Name'), style: { width: '25%' } }, - { text: gettext('Updated'), style: { width: '20%' } }, - { text: gettext('Size'), style: { width: '15%' }, classList: ['number'] }, - { text: gettext('Type') } + { text: gettext('Name'), style: { width: '25%' }, sortable: true, sortDefault: true }, + { text: gettext('Updated'), style: { width: '20%' }, sortable: true }, + { text: gettext('Size'), style: { width: '15%' }, classList: ['number'], sortable: true }, + { text: gettext('Type'), sortable: true } ], volume: [ - { text: gettext('Name'), style: { width: '25%' } }, + { text: gettext('Name'), style: { width: '25%' }, sortable: true, sortDefault: true }, { text: gettext('Type'), style: { width: '20%' } }, - { text: gettext('Size'), classList: ['number'] } + { text: gettext('Size'), classList: ['number'], sortable: true } ], snapshot: [ - { text: gettext('Name'), style: { width: '25%' } }, + { text: gettext('Name'), style: { width: '25%' }, sortable: true, sortDefault: true }, { text: gettext('Type'), style: { width: '20%' } }, - { text: gettext('Size'), classList: ['number'] } + { text: gettext('Size'), classList: ['number'], sortable: true } ], volume_snapshot: [ - { text: gettext('Name'), style: { width: '25%' } }, + { text: gettext('Name'), style: { width: '25%' }, sortable: true, sortDefault: true }, { text: gettext('Type'), style: { width: '20%' } }, - { text: gettext('Size'), classList: ['number'] } + { text: gettext('Size'), classList: ['number'], sortable: true } ] };