Hi Kuan,
Greetings from Syncfusion support.
Query: Reset search
and column chooser
By analyzing your query, you need to reset the search option
value and column chooser. We reset search value by following method
- Taking the Grid instance
- Set the
searchSetting.key to null
|
var gridObj =
document.getElementById("Grid").ej2_instances[0];
gridObj.searchSettings.key ='';
|
We reset the column chooser by saving the columns value as
object when it created and assign the object to column on reset
|
function created() {
let gridObject = document.getElementById('Grid').ej2_instances[0];
gridColumns = gridObject.columns.map((a) => Object.assign({}, a));
}
On button click function
let gridObject = document.getElementById('Grid').ej2_instances[0];
gridObject.columns = gridColumns.map((a) => Object.assign({}, a));
|
We attached a sample with it for your convenience
Please get back to us if you need further assistance on
this.
Regards,
Mohammed Ansar ,
Attachment:
resetCore_bf45b0eb.zip