Hi Craig,
Greetings from Syncfusion support
From your query we could see that you are binding the data
to the Grid after the button click using Ajax post, so you no need to define
the DataSource and Adaptor initially in the Grid component definition.
To achieve your requirement, we suggest you use the below way to achieve your
requirement.
ajax.onSuccess
= result => {
// Grid instance
var gridObj = document.getElementById('Grid').ej2_instances[0];
console.log(ej.data.DataUtil.parse.parseJson(result));
gridObj.dataSource = new ej.data.DataManager({
json: result,
adaptor: new ej.data.RemoteSaveAdaptor,
insertUrl: '/Home/Insert', //set your CRUD actions URL here
updateUrl: '/Home/Update',
removeUrl: '/Home/Delete'
});
}
|
If you still face the issue, please ensure that on ajax
Success the result has proper data in JSON format or not. Share your issue
scenario in video demonstration and share the screenshot of your result from
the ajax success.
Regards,
Rajapandi R