@@ -430,7 +430,6 @@ define([
430
430
tag . appendLine ( '<div class="vp-icon-btn vp-del-col"></div>' ) ;
431
431
432
432
var varList = this . state . dataList ;
433
- tag . appendLine ( this . templateForConditionVariableInput ( varList , this . state . pandasObject , this . state . dataType ) ) ;
434
433
435
434
tag . appendLine ( '<div class="vp-td-line">' ) ;
436
435
tag . appendLine ( this . templateForConditionColumnInput ( colList ) ) ;
@@ -1330,51 +1329,6 @@ define([
1330
1329
that . generateCode ( ) ;
1331
1330
} ) ;
1332
1331
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
-
1378
1332
$ ( document ) . on ( 'change' , this . wrapSelector ( '.vp-ds-cond-tbl .vp-col-list' ) , function ( ) {
1379
1333
var thisTag = $ ( this ) ;
1380
1334
var varName = $ ( this ) . closest ( 'td' ) . find ( '.vp-cond-var' ) . val ( ) ;
@@ -1492,8 +1446,8 @@ define([
1492
1446
var useCondition = false ;
1493
1447
for ( var i = 0 ; i < condList . length ; i ++ ) {
1494
1448
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 ;
1497
1451
var colName = colTag . find ( '.vp-col-list' ) . find ( 'option:selected' ) . data ( 'code' ) ;
1498
1452
colName = colName ? colName : '' ;
1499
1453
var oper = colTag . find ( '.vp-oper-list' ) . val ( ) ;
0 commit comments