File tree 1 file changed +5
-7
lines changed
src/extensions/filter-control 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 62
62
} ;
63
63
64
64
var addOptionToSelectControl = function ( selectControl , value , text ) {
65
- // selectControl = $(selectControl.get(0 ));
65
+ selectControl = $ ( selectControl . get ( selectControl . length - 1 ) ) ;
66
66
if ( existsOptionInSelectControl ( selectControl , value ) ) {
67
67
selectControl . append ( $ ( "<option></option>" )
68
68
. attr ( "value" , value )
87
87
} ;
88
88
89
89
var existsOptionInSelectControl = function ( selectControl , value ) {
90
- var options = selectControl . get ( 0 ) . options ,
91
- iOpt = 0 ;
92
-
93
- for ( ; iOpt < options . length ; iOpt ++ ) {
94
- if ( options [ iOpt ] . value === value ) {
90
+ var options = selectControl . get ( selectControl . length - 1 ) . options ;
91
+ for ( var i = 0 ; i < options . length ; i ++ ) {
92
+ if ( options [ i ] . value === value ) {
95
93
//The value is nor valid to add
96
94
return false ;
97
95
}
395
393
if ( column . filterData === undefined || column . filterData . toLowerCase ( ) === 'column' ) {
396
394
var selectControl = $ ( '.' + column . field ) ;
397
395
if ( selectControl !== undefined && selectControl . length > 0 ) {
398
- if ( selectControl . get ( 0 ) . options . length === 0 ) {
396
+ if ( selectControl . get ( selectControl . length - 1 ) . options . length === 0 ) {
399
397
//Added the default option
400
398
addOptionToSelectControl ( selectControl , '' , '' ) ;
401
399
}
You can’t perform that action at this time.
0 commit comments