* [bug#57479] adjust delimiter setting for dtable.
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
window.setMultipleCell = function(value, pairs, delimiter)
|
||||
window.setMultipleCell = function(value, info)
|
||||
{
|
||||
value = value.filter((data)=>data);
|
||||
value = value.filter((data) => data);
|
||||
if(!value.length) return value;
|
||||
|
||||
pairs = JSON.parse(pairs);
|
||||
pairs = info.col.setting.dataPairs;
|
||||
const result = [];
|
||||
const data = $.isArray(value) ? value : value.split(',');
|
||||
$.each(data, function(_, value)
|
||||
{
|
||||
if(value && pairs[value]) result.push(pairs[value]);
|
||||
});
|
||||
return result.join(delimiter);
|
||||
return result.join(info.col.setting.delimiter);
|
||||
};
|
||||
|
||||
@@ -175,8 +175,10 @@ class dtable extends wg
|
||||
{
|
||||
if(!empty($config['map'])) $dataPairs = $config['map'];
|
||||
if(!empty($config['userMap'])) $dataPairs = $config['userMap'];
|
||||
$delimiter = is_string($config['delimiter']) ? $config['delimiter'] : ',';
|
||||
$config['map'] = jsRaw("(value) => {return window.setMultipleCell(value, '" . json_encode($dataPairs). "', '{$delimiter}')}");
|
||||
|
||||
$config['dataPairs'] = $dataPairs;
|
||||
$config['delimiter'] = is_string($config['delimiter']) ? $config['delimiter'] : ',';
|
||||
$config['map'] = jsRaw("window.setMultipleCell");
|
||||
}
|
||||
|
||||
if(isset($config['type']))
|
||||
|
||||
Reference in New Issue
Block a user