CLOUDSTACK-1065: cloudstack UI - AWS Style Regions - implement Edit Region action, ID field shouldn't be editable since ID is the base when searching for an entry in the database.

This commit is contained in:
Jessica Wang 2013-03-20 15:39:30 -07:00
parent 75a6e009b9
commit 6cb1486f29

View File

@ -105,9 +105,15 @@
edit: { edit: {
label: 'label.edit.region', label: 'label.edit.region',
action: function(args) { action: function(args) {
var data = {
id: args.context.regions[0].id,
name: args.data.name,
endpoint: args.data.endpoint
};
$.ajax({ $.ajax({
url: createURL('updateRegion'), url: createURL('updateRegion'),
data: args.data, data: data,
success: function(json) { success: function(json) {
args.response.success(); args.response.success();
$(window).trigger('cloudStack.refreshRegions'); $(window).trigger('cloudStack.refreshRegions');
@ -154,11 +160,11 @@
title: 'label.details', title: 'label.details',
fields: [ fields: [
{ {
name: { label: 'label.name', isEditable: true }, id: { label: 'label.id' }
}, },
{ {
endpoint: { label: 'label.endpoint', isEditable: true }, name: { label: 'label.name', isEditable: true },
id: { label: 'label.id', isEditable: true } endpoint: { label: 'label.endpoint', isEditable: true }
} }
], ],
dataProvider: function(args) { dataProvider: function(args) {