Posted 5 August 2020, 8:53 pm EST
Hello Eric,
For this, we need to handle the onError event for editableCollectionView which causes the issue for the JS alert.
You may handle this event to show Custom Error message. If you would like to show Success/Error message both, you should handle the OnClientQueryData event. Please refer to the following code snippet for refernce:
<script>
function Complete(s, e) {
console.log("OnQueryComplete", e.result.operatedItemResults[0])
}
function fixDefaultJSAlert() {
var grid = wijmo.Control.getControl("#TestGrid");
// User can write his own error handling for preventing the first javascript alert
grid.editableCollectionView.onError = function (error) {
// do what you want
console.log("OnError",error);
return false;
};
}
</script>
@(Html.C1().FlexGrid().Id("TestGrid")
.AutoGenerateColumns(false)
.Bind(m=>m.Bind(Model.Data).Update(Url.Action("GridUpdate", "Home")).OnClientQueryComplete("Complete"))
.Height(200)
.Columns(cb =>
{
cb.Add().Binding("ID");
cb.Add().Binding("First");
cb.Add().Binding("Last");
cb.Add().Binding("Sales");
cb.Add().Binding("Hired");
cb.Add().Binding("CountryID");
cb.Add().Binding("Active");
})
.OnClientLoadedRows("fixDefaultJSAlert")
)
Regards,
Manish Gupta