File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -1760,6 +1760,7 @@ define([
1760
1760
} ) ;
1761
1761
1762
1762
$ ( document ) . on ( 'change' , this . wrapSelector ( '.vp-ds-cond-tbl .vp-col-list' ) , function ( ) {
1763
+ var thisTag = $ ( this ) ;
1763
1764
var varName = $ ( this ) . closest ( 'td' ) . find ( '.vp-cond-var' ) . val ( ) ;
1764
1765
var colName = $ ( this ) . find ( 'option:selected' ) . attr ( 'data-code' ) ;
1765
1766
@@ -1769,6 +1770,12 @@ define([
1769
1770
// get result and load column list
1770
1771
kernelApi . executePython ( code , function ( result ) {
1771
1772
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
+ }
1772
1779
$ ( condTag ) . replaceWith ( function ( ) {
1773
1780
return that . renderConditionCondInput ( category ) ;
1774
1781
} ) ;
You can’t perform that action at this time.
0 commit comments