Skip to content

Commit 9ba043e

Browse files
author
minjk-bl
committed
Subset condition box changed
1 parent a0e569f commit 9ba043e

File tree

2 files changed

+5
-48
lines changed

2 files changed

+5
-48
lines changed

css/m_apps/subset.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@
116116
.vp-ds-rowtype-box.condition .vp-td-line {
117117
padding-bottom: 5px;
118118
}
119+
.vp-ds-rowtype-box.condition table {
120+
width: 100%;
121+
}
119122
.vp-ds-rowtype-box.condition table td {
120123
padding-bottom: 20px;
121124
}

js/m_apps/Subset.js

Lines changed: 2 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,6 @@ define([
430430
tag.appendLine('<div class="vp-icon-btn vp-del-col"></div>');
431431

432432
var varList = this.state.dataList;
433-
tag.appendLine(this.templateForConditionVariableInput(varList, this.state.pandasObject, this.state.dataType));
434433

435434
tag.appendLine('<div class="vp-td-line">');
436435
tag.appendLine(this.templateForConditionColumnInput(colList));
@@ -1330,51 +1329,6 @@ define([
13301329
that.generateCode();
13311330
});
13321331

1333-
// typing on condition variable
1334-
$(document).on('change var_changed', this.wrapSelector('.vp-ds-cond-tbl .vp-cond-var'), function () {
1335-
var varType = $(this).attr('data-type');
1336-
var colTag = $(this).closest('td').find('.vp-col-list');
1337-
if (varType == 'DataFrame') {
1338-
// pd Object selected
1339-
var varName = $(this).val();
1340-
if (varName == '') {
1341-
$(colTag).attr('disabled', true);
1342-
$(colTag).replaceWith(function () {
1343-
return that.templateForConditionColumnInput([]);
1344-
});
1345-
that.generateCode();
1346-
return;
1347-
}
1348-
// dataframe column search
1349-
var colCode = com_util.formatString('_vp_print(_vp_get_columns_list({0}))', varName);
1350-
// get result and load column list
1351-
vpKernel.execute(colCode).then(function (resultObj) {
1352-
let { result } = resultObj;
1353-
var colList = JSON.parse(result);
1354-
colList = colList.map(function (x) {
1355-
return {
1356-
...x,
1357-
value: x.label,
1358-
code: x.value
1359-
};
1360-
});
1361-
$(colTag).replaceWith(function () {
1362-
return that.templateForConditionColumnInput(colList);
1363-
});
1364-
$(colTag).attr('disabled', false);
1365-
that.generateCode();
1366-
});
1367-
} else {
1368-
$(colTag).val('');
1369-
$(colTag).attr('placeholder', '');
1370-
$(colTag).attr('disabled', true);
1371-
$(colTag).replaceWith(function () {
1372-
return that.templateForConditionColumnInput([]);
1373-
});
1374-
that.generateCode();
1375-
}
1376-
});
1377-
13781332
$(document).on('change', this.wrapSelector('.vp-ds-cond-tbl .vp-col-list'), function () {
13791333
var thisTag = $(this);
13801334
var varName = $(this).closest('td').find('.vp-cond-var').val();
@@ -1492,8 +1446,8 @@ define([
14921446
var useCondition = false;
14931447
for (var i = 0; i < condList.length; i++) {
14941448
var colTag = $(condList[i]);
1495-
var varName = colTag.find('.vp-cond-var').val();
1496-
var varType = colTag.find('.vp-cond-var').data('type');
1449+
var varName = this.state.pandasObject;
1450+
var varType = this.state.dataType;
14971451
var colName = colTag.find('.vp-col-list').find('option:selected').data('code');
14981452
colName = colName ? colName : '';
14991453
var oper = colTag.find('.vp-oper-list').val();

0 commit comments

Comments
 (0)