From 726ecb8593daeb0f4ecf82280e8901dbc4281821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Sun, 24 Jan 2021 12:09:56 +0300 Subject: [PATCH] Select group set array field issue solved.. --- .../assets/js/components/AkauntingSelect.vue | 73 ++++++++++++++----- 1 file changed, 53 insertions(+), 20 deletions(-) diff --git a/resources/assets/js/components/AkauntingSelect.vue b/resources/assets/js/components/AkauntingSelect.vue index 49b32c43a..c4352f946 100644 --- a/resources/assets/js/components/AkauntingSelect.vue +++ b/resources/assets/js/components/AkauntingSelect.vue @@ -314,11 +314,19 @@ export default { } } else { this.options.forEach(function (option, index) { - this.sort_options.push({ - index: index, - key: option.id, - value: (option.title) ? option.title : (option.display_name) ? option.display_name : option.name - }); + if (typeof(option) == 'string') { + this.sort_options.push({ + index: index, + key: index.toString(), + value: option + }); + } else { + this.sort_options.push({ + index: index, + key: option.id, + value: (option.title) ? option.title : (option.display_name) ? option.display_name : option.name + }); + } }, this); } } else { @@ -332,11 +340,19 @@ export default { } } else { this.options.forEach(function (option, index) { - this.sort_options.push({ - index: index, - key: option.id, - value: (option.title) ? option.title : (option.display_name) ? option.display_name : option.name - }); + if (typeof(option) == 'string') { + this.sort_options.push({ + index: index, + key: index.toString(), + value: option + }); + } else { + this.sort_options.push({ + index: index, + key: option.id, + value: (option.title) ? option.title : (option.display_name) ? option.display_name : option.name + }); + } }, this); } } @@ -399,6 +415,7 @@ export default { return 0; } }, + change() { // This controll added add new changed.. if (typeof(this.selected) === 'object' && typeof(this.selected.type) !== 'undefined') { @@ -769,11 +786,19 @@ export default { } } else { options.forEach(function (option, index) { - this.sort_options.push({ - index: index, - key: option.id, - value: (option.title) ? option.title : (option.display_name) ? option.display_name : option.name - }); + if (typeof(option) == 'string') { + this.sort_options.push({ + index: index, + key: index.toString(), + value: option + }); + } else { + this.sort_options.push({ + index: index, + key: option.id, + value: (option.title) ? option.title : (option.display_name) ? option.display_name : option.name + }); + } }, this); } } else { @@ -787,11 +812,19 @@ export default { } } else { options.forEach(function (option, index) { - this.sort_options.push({ - index: index, - key: option.id, - value: (option.title) ? option.title : (option.display_name) ? option.display_name : option.name - }); + if (typeof(option) == 'string') { + this.sort_options.push({ + index: index, + key: index.toString(), + value: option + }); + } else { + this.sort_options.push({ + index: index, + key: option.id, + value: (option.title) ? option.title : (option.display_name) ? option.display_name : option.name + }); + } }, this); } }