File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1760,6 +1760,7 @@ define([
17601760 } ) ;
17611761
17621762 $ ( document ) . on ( 'change' , this . wrapSelector ( '.vp-ds-cond-tbl .vp-col-list' ) , function ( ) {
1763+ var thisTag = $ ( this ) ;
17631764 var varName = $ ( this ) . closest ( 'td' ) . find ( '.vp-cond-var' ) . val ( ) ;
17641765 var colName = $ ( this ) . find ( 'option:selected' ) . attr ( 'data-code' ) ;
17651766
@@ -1769,6 +1770,12 @@ define([
17691770 // get result and load column list
17701771 kernelApi . executePython ( code , function ( result ) {
17711772 var category = JSON . parse ( result ) ;
1773+ if ( category && category . length > 0 ) {
1774+ // if it's categorical column, check 'Text' as default
1775+ $ ( thisTag ) . closest ( 'td' ) . find ( '.vp-cond-use-text' ) . prop ( 'checked' , true ) ;
1776+ } else {
1777+ $ ( thisTag ) . closest ( 'td' ) . find ( '.vp-cond-use-text' ) . prop ( 'checked' , false ) ;
1778+ }
17721779 $ ( condTag ) . replaceWith ( function ( ) {
17731780 return that . renderConditionCondInput ( category ) ;
17741781 } ) ;
You can’t perform that action at this time.
0 commit comments