Manually trigger specific event in Wijmo FlexGrid

Posted by: AArnautov on 2 October 2017, 10:36 am EST

  • Posted 2 October 2017, 10:36 am EST

    Hi,

    I’m wondering if there is a way I can manually trigger specific event on each column in FlexGrid wijmo. I’m not using the angular version. So i would like to have something like :

    this.gridInstance.columns.forEach(function(item){

    // trigger the event for each columns for example : resizedColumn

    // and then execute the code that is in

    // this.gridInstance.onResizedColumn = function(s) {

    // console.log(“something”)

    //})

    });

  • Posted 4 October 2017, 5:13 am EST

    Hi,

    We are sorry for the late reply.

    You can trigger event for FlexGrid manually but as we know this is not a best practice. Please refer to the following code snippet for the same:

    this.grid.columns.forEach((element,index)=>{
    	let cellRange= new wijGrid.CellRangeEventArgs( this.grid, new wijGrid.CellRange(-1,index,-1,index); 
    	// trigger resized column manually
    	this.grid.onResizedColumn(cellRange);
    });
    // handle resized column event which trigger when column resized by double click on column border or manually event trigger as above
    this.grid.resizedColumn.addHandler((s:wjGrid.FlexGrid,e:wjGrid.CellRangeEventArgs)=>{
    	console.log(`Column ${e.col} resized`);
    });
    

    Hope it helps!

    Thanks,

    Manish Kumar Gupta

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels