User editable dashboards... implementation in progress

SVN:trunk[2036]
This commit is contained in:
Denis Flaven
2012-05-25 10:22:22 +00:00
parent d6aa4118b0
commit e56aac9ef8
2 changed files with 44 additions and 30 deletions

View File

@@ -66,10 +66,6 @@ $(function()
{
// in 1.9 would use _super
$.Widget.prototype._setOption.call( this, key, value );
if (key == 'layout')
{
_refresh();
}
},
_get_state: function(oMergeInto)
{

View File

@@ -10,7 +10,9 @@ $(function()
{
field_id: '',
submit_to: 'index.php',
submit_parameters: {operation: 'async_action'}
submit_parameters: {operation: 'async_action'},
do_apply: null,
do_cancel: null
},
@@ -97,6 +99,13 @@ $(function()
return { name: $('#'+this.options.field_id).attr('name'), value: this.value };
},
_do_apply: function()
{
if (this.options.do_apply)
{
// specific behavior...
this.options.do_apply();
}
else
{
// Validate the field
sFormId = this.element.closest('form').attr('id');
@@ -110,8 +119,16 @@ $(function()
this._do_submit();
this._refresh();
}
}
},
_do_cancel: function()
{
if (this.options.do_cancel)
{
// specific behavior...
this.options.do_cancel();
}
else
{
this.bModified = false;
var oField = $('#'+this.options.field_id);
@@ -133,6 +150,7 @@ $(function()
this._refresh();
oField.trigger('reverted', {type: 'designer', previous_value: this.value });
oField.trigger('validate');
}
},
_do_submit: function()
{