Skip to content

Commit 5571ddc

Browse files
author
minjk-bl
committed
Fixed Load/Save operation for DataSelector, Seaborn, WordCloud
1 parent 0792ab9 commit 5571ddc

File tree

5 files changed

+210
-99
lines changed

5 files changed

+210
-99
lines changed

css/component/dataSelector.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
right: 25px;
1010
cursor: pointer;
1111
}
12-
.vp-ds-box input {
12+
.vp-ds-box input.vp-ds-target {
1313
padding-right: 23px;
1414
}
15-
.vp-ds-box input:disabled {
15+
.vp-ds-box input.vp-ds-target:disabled {
1616
background: var(--light-gray-color) !important;
1717
cursor: not-allowed;
1818
}
19-
.vp-ds-box input:disabled + .vp-ds-filter {
19+
.vp-ds-box input.vp-ds-target:disabled + .vp-ds-filter {
2020
cursor: not-allowed;
2121
}
2222
.vp-ds-item:hover {

js/com/com_generatorV2.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -654,26 +654,23 @@ define([
654654

655655
/**
656656
* Bind columns source function
657-
* @param {string} selector thisWrapSelector
658-
* @param {object} target
657+
* @param {object} pageThis
658+
* @param {object} targetId
659659
* @param {array} columnInputIdList
660660
* @param {string} tagType input / select (tag type)
661661
* @param {array/boolean} columnWithEmpty boolean array or value to decide whether select tag has empty space
662662
* @param {array/boolean} columnWithIndex boolean array or value to decide whether select tag has index option
663663
* Usage :
664664
* $(document).on('change', this.wrapSelector('#dataframe_tag_id'), function() {
665-
* pdGen.vp_bindColumnSource(that.wrapSelector(), this, ['column_input_id'], 'select', [true, true, true]);
665+
* pdGen.vp_bindColumnSource(that, 'dataframe_tag_id', ['column_input_id'], 'select', [true, true, true]);
666666
* });
667667
*/
668-
var vp_bindColumnSource = function(selector, target, columnInputIdList, tagType="input", columnWithEmpty=false, columnWithIndex=false) {
669-
var varName = '';
670-
if ($(target).length > 0) {
671-
varName = $(target).val();
672-
}
668+
var vp_bindColumnSource = function(pageThis, targetId, columnInputIdList, tagType="input", columnWithEmpty=false, columnWithIndex=false) {
669+
var varName = pageThis.state[targetId];
673670
if (varName === '') {
674671
// reset with no source
675672
columnInputIdList && columnInputIdList.forEach(columnInputId => {
676-
let defaultValue = $(selector + ' #' + columnInputId).val();
673+
let defaultValue = pageThis.state[columnInputId];
677674
if (defaultValue == null || defaultValue == undefined) {
678675
defaultValue = '';
679676
}
@@ -735,7 +732,7 @@ define([
735732

736733
// columns using suggestInput
737734
columnInputIdList && columnInputIdList.forEach((columnInputId, idx) => {
738-
let defaultValue = $(selector + ' #' + columnInputId).val();
735+
let defaultValue = pageThis.state[columnInputId];
739736
if (defaultValue == null || defaultValue == undefined) {
740737
defaultValue = '';
741738
}
@@ -771,7 +768,7 @@ define([
771768
option.append(document.createTextNode(listVar.label));
772769
$(tag).append(option);
773770
});
774-
$(selector + ' #' + columnInputId).replaceWith(function() {
771+
$(pageThis.wrapSelector('#' + columnInputId)).replaceWith(function() {
775772
return $(tag);
776773
});
777774
}

0 commit comments

Comments
 (0)