File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -474,18 +474,7 @@ export function createControls (that, header) {
474474 const $selectControl = $ ( currentTarget )
475475 const value = $selectControl . val ( )
476476
477- if ( Array . isArray ( value ) ) {
478- for ( let i = 0 ; i < value . length ; i ++ ) {
479- if ( value [ i ] && value [ i ] . length > 0 && value [ i ] . trim ( ) ) {
480- $selectControl . find ( `option[value="${ value [ i ] } "]` ) . attr ( 'selected' , true )
481- }
482- }
483- } else if ( value && value . length > 0 && value . trim ( ) ) {
484- $selectControl . find ( 'option[selected]' ) . removeAttr ( 'selected' )
485- $selectControl . find ( `option[value="${ value } "]` ) . attr ( 'selected' , true )
486- } else {
487- $selectControl . find ( 'option[selected]' ) . removeAttr ( 'selected' )
488- }
477+ $selectControl . val ( value === null ? $selectControl . prop ( 'multiple' ) ? [ ] : null : value )
489478
490479 clearTimeout ( currentTarget . timeoutId || 0 )
491480 currentTarget . timeoutId = setTimeout ( ( ) => {
Original file line number Diff line number Diff line change @@ -89,6 +89,14 @@ $.BootstrapTable = class extends $.BootstrapTable {
8989 renderStickyHeader ( ) {
9090 const that = this
9191
92+ if (
93+ ! this . $stickyContainer || ! this . $stickyContainer . length ||
94+ ! this . $stickyBegin || ! this . $stickyBegin . length ||
95+ ! this . $stickyEnd || ! this . $stickyEnd . length
96+ ) {
97+ return
98+ }
99+
92100 this . $stickyHeader = this . $header . clone ( true , true )
93101
94102 if ( this . options . filterControl ) {
@@ -103,8 +111,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
103111 } else if ( $target . is ( 'select' ) ) {
104112 const $select = $coreTh . find ( 'select' )
105113
106- $select . find ( 'option[selected]' ) . removeAttr ( 'selected' )
107- $select . find ( `option[value="${ value } "]` ) . attr ( 'selected' , true )
114+ $select . val ( value === null ? $select . prop ( 'multiple' ) ? [ ] : null : value )
108115 }
109116
110117 that . triggerSearch ( )
You can’t perform that action at this time.
0 commit comments