@@ -36,8 +36,8 @@ class QgridModel extends widgets.DOMWidgetModel {
36
36
_view_name : 'QgridView' ,
37
37
_model_module : 'qgrid' ,
38
38
_view_module : 'qgrid' ,
39
- _model_module_version : '^1.0.5 ' ,
40
- _view_module_version : '^1.0.5 ' ,
39
+ _model_module_version : '^1.0.6-beta.6 ' ,
40
+ _view_module_version : '^1.0.6-beta.6 ' ,
41
41
_df_json : '' ,
42
42
_columns : { }
43
43
} ) ;
@@ -204,6 +204,7 @@ class QgridView extends widgets.DOMWidgetView {
204
204
this . data_view = this . create_data_view ( df_json . data ) ;
205
205
this . grid_options = this . model . get ( 'grid_options' ) ;
206
206
this . index_col_name = this . model . get ( "_index_col_name" ) ;
207
+ this . row_styles = this . model . get ( "_row_styles" ) ;
207
208
208
209
this . columns = [ ] ;
209
210
this . index_columns = [ ] ;
@@ -301,7 +302,9 @@ class QgridView extends widgets.DOMWidgetView {
301
302
$ . datepicker . setDefaults ( {
302
303
gotoCurrent : true ,
303
304
dateFormat : $ . datepicker . ISO_8601 ,
304
- constrainInput : false
305
+ constrainInput : false ,
306
+ "prevText" : "" ,
307
+ "nextText" : ""
305
308
} ) ;
306
309
307
310
var sorted_columns = Object . values ( columns ) . sort (
@@ -346,6 +349,15 @@ class QgridView extends widgets.DOMWidgetView {
346
349
if ( cur_column . is_index ) {
347
350
slick_column . editor = editors . IndexEditor ;
348
351
slick_column . cssClass += ' idx-col' ;
352
+ if ( cur_column . first_index ) {
353
+ slick_column . cssClass += ' first-idx-col' ;
354
+ }
355
+ if ( cur_column . last_index ) {
356
+ slick_column . cssClass += ' last-idx-col' ;
357
+ }
358
+
359
+ slick_column . name = cur_column . index_display_text ;
360
+ slick_column . level = cur_column . level ;
349
361
this . index_columns . push ( slick_column ) ;
350
362
continue ;
351
363
}
@@ -386,6 +398,7 @@ class QgridView extends widgets.DOMWidgetView {
386
398
} , 1 ) ;
387
399
388
400
this . slick_grid . setSelectionModel ( new Slick . RowSelectionModel ( ) ) ;
401
+ this . slick_grid . setCellCssStyles ( "grouping" , this . row_styles ) ;
389
402
this . slick_grid . render ( ) ;
390
403
391
404
var render_header_cell = ( e , args ) => {
@@ -469,7 +482,7 @@ class QgridView extends widgets.DOMWidgetView {
469
482
} ;
470
483
this . send ( msg ) ;
471
484
this . viewport_timeout = null ;
472
- } , 100 ) ;
485
+ } , 10 ) ;
473
486
} ) ;
474
487
475
488
// set up callbacks
@@ -631,6 +644,8 @@ class QgridView extends widgets.DOMWidgetView {
631
644
}
632
645
this . update_timeout = setTimeout ( ( ) => {
633
646
var df_json = JSON . parse ( this . model . get ( '_df_json' ) ) ;
647
+ this . row_styles = this . model . get ( "_row_styles" ) ;
648
+ this . multi_index = this . model . get ( "_multi_index" ) ;
634
649
var data_view = this . create_data_view ( df_json . data ) ;
635
650
636
651
if ( msg . triggered_by == 'sort_changed' && this . sort_indicator ) {
@@ -649,6 +664,23 @@ class QgridView extends widgets.DOMWidgetView {
649
664
}
650
665
651
666
this . set_data_view ( data_view ) ;
667
+
668
+ var skip_grouping = false ;
669
+ if ( this . multi_index ) {
670
+ for ( var i = 1 ; i < this . filter_list . length ; i ++ ) {
671
+ var cur_filter = this . filter_list [ i ] ;
672
+ if ( cur_filter . is_active ( ) ) {
673
+ skip_grouping = true ;
674
+ }
675
+ }
676
+ }
677
+
678
+ if ( skip_grouping ) {
679
+ this . slick_grid . removeCellCssStyles ( "grouping" ) ;
680
+ } else {
681
+ this . slick_grid . setCellCssStyles ( "grouping" , this . row_styles ) ;
682
+ }
683
+
652
684
this . slick_grid . render ( ) ;
653
685
654
686
if ( ( msg . triggered_by == 'add_row' ||
@@ -674,7 +706,7 @@ class QgridView extends widgets.DOMWidgetView {
674
706
'rows' : selected_rows ,
675
707
'type' : 'selection_changed'
676
708
} ) ;
677
- } , 100 ) ;
709
+ } , 10 ) ;
678
710
} else if ( msg . col_info ) {
679
711
var filter = this . filters [ msg . col_info . name ] ;
680
712
filter . handle_msg ( msg ) ;
0 commit comments