resizing columns manually keeps cursor busy on the Grid

HI, im doing a prortotype on the grid so when the window changes size or i resize columns i have this code 

aoGrid_resetColWidth() {
if(this.gState.colsToResize === false) {
return
}
this.gState.colsDataSetts.forEach(item=>{
this.$refs.grid.getColumnByField(item.name).width = item.width;
//this.$refs.grid.refreshColumns();
})
this.$refs.grid.refreshColumns();
this.gState.colsToResize=false
},


In the DATA part 

gState: {
currentSort: null,
colsToResize: false,
colsDataSetts: [
{ name: 'clave_cat', label:'Clave', width: 100, visible:true, allowHide:true },
{ name: 'nombre', label:'Nombre', width: 'auto', visible:true, allowHide:false },
{ name: 'alias', label:'Alias/Abrev.', width: 170, visible:true, allowHide:true },
{ name: 'base_contable', label:'Base cont.', width: 190, visible:true, allowHide:true },
{ name: 'activo', label:'Activo', width: 100, visible:true, allowHide:true }
]
},


and for last the code in the Action begin and complete 

aogrid_actionComplete (args) {
if (args.requestType === 'sorting') {
console.log(' $$$--- ' + args.requestType + ' action completed for ' + args.columnName + ' column' )
} else if (args.requestType === 'paging') {
console.log(` ----- Now you are in page ${args.currentPage}`)
} else {
console.log(' $$$--- ' + args.requestType + ' action completed')
}
},
aogrid_actionBegin (args) {
console.log('Action begin --- ', args)
if (args.requestType === 'sorting') {
if (!args.direction){
console.log('Action SORTING --- NO DIRECTION', args)
var indexCol = args.target.closest('th').cellIndex
var column = this.$refs.grid.ej2Instances.getColumnByIndex(indexCol).field
this.$refs.grid.ej2Instances.sortColumn(column, 'Ascending',false)
} else {
args.cancel = this.grid_doSorting(args)
if (!args.cancel){
this.initDataSource({page: 1, currentPage:1})
}
}
} else if (args.requestType === 'paging') {
console.log('Action PAGING --- ', args)
this.initDataSource({page: args.currentPage, currentPage: args.currentPage, pageSize: args.pageSize })
} else {
args.cancel = false
}
if (args.cancel===true){
console.log(' $$$--- ' + args.requestType + ' action cancelled for ' + args + ' column' )
}
},

after calling 

this.$refs.grid.refreshColumns();

It consoles   Object { requestType: "refresh", name: "actionBegin" }

Image_4944_1730936395369

But the action never ends and the cursor gets always busy 

Any pointers or what im doing wrong ? 

Also I checked on documentation but the sample no work



2 Replies

CM carlos mendez November 7, 2024 12:14 AM UTC

finally took a dive on the source code of the GRID and  i see some weird stuff (code) about frozen columns and locked columns  which in my case i dont have locked columns or frozen columns  its just a simple grid 

Grid.prototype.refreshColumns = function () {


Located. at node_modules/@syncfusion/ej2-grids/src/grid/base/grid.js  inside the project

so i tried 

this.$refs.grid.refreshHeader()

and worked (no more busy cursor). So it seems that documentation is not accurate after all 

anyways, i wait for a reply to see if i have some missing props or settings 



VS Vikram Sundararajan Syncfusion Team November 13, 2024 03:40 AM UTC

Hi carlos mendez,


Greetings from Syncfusion support,


We understand that you’re experiencing a persistent busy cursor issue when calling refreshColumns() after resizing columns and found that using refreshHeader() avoids this problem.


We would like to inform you that when you call the grid’s refreshColumns API method, it will refresh the whole grid for updating dataSource purposes. On the other hand, refreshHeader() only refreshes the Grid’s header section without fully re-rendering the columns. We have created a sample based on the code details you provided, but we are unable to reproduce the busy cursor issue. You can view and interact with the sample here:


Sample: https://stackblitz.com/edit/knwz2f-1zmk2v?file=src%2FApp.vue


We recommend using this sample as a reference to address the issue. If the problem persists, please share a reproducible sample, or try replicating the issue in the shared sample to help us investigate further.


Regards,

Vikram S


Loader.
Up arrow icon