- Ppgrade jquery

- Early detection of table existency (on creation)
- Replaced deprecated ajax calls (defer)
This commit is contained in:
2014-09-05 23:13:55 +02:00
parent 7df342462b
commit ecc3471ebc
5 changed files with 68 additions and 72 deletions

View File

@@ -60,7 +60,7 @@ function Table(oTable)
this.sFeedBackBoxId = '#validation';
tableself = this;
$('#title').addDefaultValue('Nom de la table');
$('#title').addDefaultValue('Nom de la table').blur(tableself.checkTitle);
$('#description').addDefaultValue('Description');
$('#validation').addButton('dummy', '', function(){}, this.ACTION_BTN_ID, '', this.ACTION_BTN_ID);
this.$Button = databap.tmp(this.ACTION_BTN_ID);
@@ -143,10 +143,11 @@ Table.prototype.setDisplay = function(sDisplay)
databap.updateScrollBar();
};
Table.prototype.save = function()
Table.prototype.save = function(bSimul)
{
bSimul = bSimul || false;
var $Form = $('#table_info');
if($Form.checkForm())
if(bSimul || $Form.checkForm())
{
databap.saveForm
(
@@ -154,19 +155,19 @@ Table.prototype.save = function()
$Form,
function(asData)
{
if(asData.result == databap.consts.success)
{
databap.goToInternalLink('table', asData.name.toUpperCase());
//tableself.iTableId = asData.name;
//tableself.applyTableInfo();
}
else databap.addErrorBefore(asData.desc, tableself.sFeedBackBoxId);
if(asData.result == databap.consts.success) databap.goToInternalLink('table', asData.name.toUpperCase());
else if(asData.desc!='') databap.addErrorBefore(asData.desc, tableself.sFeedBackBoxId);
},
true,
'json'
!bSimul,
'json',
{simul:bSimul?1:0}
);
}
else databap.addWarningBefore('Formulaire incomplet', tableself.sFeedBackBoxId);
};
Table.prototype.checkTitle = function()
{
if($('#title').val()!='') tableself.save(true);
};
</script>