Hi
Currently i have an change on an drop in a Grid and then i change some any data too, but i could not refresh grid after all my jquery changes
Regards
In first step i change an codeErreur with an dropdown then i change on others lines in grid same field, but i could not refresh my grid
var getDatasourceFromUrlDetailEtatCompte = function (relativeUrl, schema) {
return new kendo.data.DataSource({
transport: {
dataType: "json",
read: {
url: UtilService.generateApiUrl(relativeUrl)
}
},
change: function (e) {
if (e.action === "itemchange") {
var errload = {
type: e.items[0].type,
source: e.items[0].source,
compte: e.items[0].compte,
date: e.items[0].date,
facture: e.items[0].facture,
total: e.items[0].total,
codeErreur: e.items[0].codeErreur
};
RapportsService.saveErreurEtatCompte(errload).then(function success(response) {
console.log('ChangementB:' + response);
e.items[0].dirty = false;
const ref_facture = e.items[0].facture;
const ref_source = e.items[0].source;
const ref_codeErreur = e.items[0].codeErreur;
var tgrid = e.sender._data;
for (var i = 0; i < tgrid.length; i++) {
if (tgrid[i].facture == ref_facture && tgrid[i].source != ref_source) {
tgrid[i].codeErreur = ref_codeErreur; // change same error code
var errload2 = {
type: tgrid[i].type,
source: tgrid[i].source,
compte: tgrid[i].compte,
date: tgrid[i].date,
facture: tgrid[i].facture,
total: tgrid[i].total,
codeErreur: tgrid[i].codeErreur
};
RapportsService.saveErreurEtatCompte(errload2).then(function success(response2) {
}, function error(response2) {
console.log('Error change:' + response2);
});
}
}
NotificationService.removeAll();
NotificationService.showSuccessP("global.save.success");
}, function error(response) {
console.log('Changementc:' + response);
if (!UtilService.responseValidationParsing(response)) {
NotificationService.showErrorP("global.save.error");
}
});
}
},
schema: schema
});
};