Fixed the javascript in the new relation area. Fixed gh-294 that hade count not array errors. Added the option to over-ride the column name in the new relation area.

This commit is contained in:
2018-05-29 05:45:16 +02:00
parent f7be7ddad0
commit a7c3a6e8f2
16 changed files with 120 additions and 29 deletions

View File

@ -26,12 +26,19 @@ function getCodeGlueOptions(field) {
var type = jQuery('#'+subID+'__join_type').val();
// get area value
var area = jQuery('#'+subID+'__area').val();
// get codeGlueOptions
getCodeGlueOptions_server(listfield, joinfields, type, area).done(function(result) {
if(result){
jQuery('#'+subID+'__set').val(result);
}
});
// check that values are set
if (_isSet(listfield) && _isSet(joinfields) && _isSet(type) && _isSet(area)) {
// get codeGlueOptions
getCodeGlueOptions_server(listfield, joinfields, type, area).done(function(result) {
if(result){
jQuery('#'+subID+'__set').val(result);
} else {
jQuery('#'+subID+'__set').val('');
}
});
} else {
jQuery('#'+subID+'__set').val('');
}
}
function getCodeGlueOptions_server(listfield, joinfields, type, area){
@ -48,4 +55,12 @@ function getCodeGlueOptions_server(listfield, joinfields, type, area){
});
}
// the isSet function
function _isSet(val)
{
if ((val != undefined) && (val != null) && 0 !== val.length){
return true;
}
return false;
}