@@ -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 ] ;
673670if ( varName === '' ) {
674671// reset with no source
675672columnInputIdList && columnInputIdList . forEach ( columnInputId => {
676- let defaultValue = $ ( selector + ' #' + columnInputId ) . val ( ) ;
673+ let defaultValue = pageThis . state [ columnInputId ] ;
677674if ( defaultValue == null || defaultValue == undefined ) {
678675defaultValue = '' ;
679676}
@@ -735,7 +732,7 @@ define([
735732
736733// columns using suggestInput
737734columnInputIdList && columnInputIdList . forEach ( ( columnInputId , idx ) => {
738- let defaultValue = $ ( selector + ' #' + columnInputId ) . val ( ) ;
735+ let defaultValue = pageThis . state [ columnInputId ] ;
739736if ( defaultValue == null || defaultValue == undefined ) {
740737defaultValue = '' ;
741738}
@@ -771,7 +768,7 @@ define([
771768option . append ( document . createTextNode ( listVar . label ) ) ;
772769$ ( tag ) . append ( option ) ;
773770} ) ;
774- $ ( selector + ' #'+ columnInputId ) . replaceWith ( function ( ) {
771+ $ ( pageThis . wrapSelector ( ' #'+ columnInputId ) ) . replaceWith ( function ( ) {
775772return $ ( tag ) ;
776773} ) ;
777774}