I'm binding a data source using ajax with the following code:
let ajax = new ej.base.Ajax(
url: $('#Grid').attr('data-url'),
type: "POST",
data: JSON.stringify(getParameters())
});
ajax.send();
ajax.onSuccess = function (data) {
grid.dataSource = JSON.parse(data);
};
The
getParameters() function returns an object with values that the user can set
dynamically.
I'm attempting to reload the data and refresh the grid by calling
ajax.send() whenever the values change.
The problem is that since the
ej.base.Ajax
object was created at runtime, it is not posting with the new values, and the request is made with the values as they were on page load.
How can I post with dynamic values and refresh the grid with the new data that is received from the server?
Thanks