This repository was archived by the owner on Jun 1, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed
src/app/modules/angular-slickgrid/services Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -79,8 +79,20 @@ export class FilterService {
7979
8080 /** Clear the search filters (below the column titles) */
8181 clearFilters ( ) {
82- // remove the text inside each search input fields
83- $ ( '.slick-headerrow-column .search-filter' ) . val ( '' ) ;
82+ // remove the text inside each search filter fields
83+ $ ( '.slick-headerrow-column .search-filter' ) . each ( ( index : number , elm : HTMLElement ) => {
84+ // clear the value and trigger an event
85+ // the event is for GraphQL & OData Services to detect the changes and call a new query
86+ switch ( elm . tagName ) {
87+ case 'SELECT' :
88+ $ ( elm ) . val ( '' ) . trigger ( 'change' ) ;
89+ break ;
90+ case 'INPUT' :
91+ default :
92+ $ ( elm ) . val ( '' ) . trigger ( 'keyup' ) ;
93+ break ;
94+ }
95+ } ) ;
8496
8597 // we need to loop through all columnFilters and delete them 1 by 1
8698 // only trying to make columnFilter an empty (without looping) would not trigger a dataset change
Original file line number Diff line number Diff line change @@ -90,7 +90,8 @@ export class GridExtraService {
9090 }
9191 }
9292
93- /** Add an item (data item) to the datagrid
93+ /**
94+ * Add an item (data item) to the datagrid
9495 * @param object dataItem: item object holding all properties of that row
9596 */
9697 addItemToDatagrid ( item ) {
@@ -113,7 +114,8 @@ export class GridExtraService {
113114 const datasetLength = this . _dataView . getLength ( ) ;
114115 }
115116
116- /** Update an existing item with new properties inside the datagrid
117+ /**
118+ * Update an existing item with new properties inside the datagrid
117119 * @param object item: item object holding all properties of that row
118120 */
119121 updateDataGridItem ( item : any ) {
You can’t perform that action at this time.
0 commit comments