trying to individualize SF-DataGrids Delete confirm dialog I use these two Javascript functions I found in one of Your examples:
function beforeOpen(args) {
var gridobj = $("#ProduktauswahlGrid").data("ejGrid");
var data = gridobj.model.currentViewData[gridobj.model.selectedRowIndex]; // get the details of the selected record
$("#" + this.element.attr("id")).find(".details").remove();
$("#" + this.element.attr("id")).prepend("Sind Sie sicher, dass Sie die Produktauswahl '" + data.Bezeichnung + "' löschen wollen?");
}
function dataBound(args) {
$("#" + this.element.attr("id") + "ConfirmDialog_wrapper").prepend("Löschen bestätigen");
$("#" + this.element.attr("id") + "ConfirmDialog").ejDialog({
beforeOpen: "beforeOpen" // bind the function beforeOpen to the beforeOpen event of the ejDialog
});
}
Unfortunately my individual confirm dialog text appears ADDITIONALLY in front oft he standard text:
Things get even worse when I call the delete a second, third, …. Time - every new individual confirm dialog text is prepended additionally:
Can You please tell me what’s going wrong here?
Thank You
Best Regards
Anis Helaoui
|
<script>
function beforeOpen(args) {
............
this.element.find("div.customconten").remove();
var elem = ej.buildTag("div.customconten", "Sind Sie sicher, dass Sie die Produktauswahl '" + data. Bezeichnung + "' löschen wollen?");
this.element.prepend(elem);
}
function dataBound(args) {
........
}
</script>
|
|
@(Html.EJ().Grid<EmployeeView>("sGrid")
..............
.CssClass("deleteDialog")
..............
)
<style type="text/css">
.e-grid.deleteDialog div[id*='ConfirmDialog'] > div.e-content {
display: none;
}
</style> |