Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
141863 | Jan 8,2019 06:48 PM UTC | Jan 21,2019 01:19 PM UTC | Angular - EJ 2 | 9 |
![]() |
Tags: Grid |
...
updateRecord(state: DataSourceChangedEventArgs): Observable<any> {
return this.http.put(this.customersUrl, state.data, httpOptions);
}
... |
// POST: Sociedad/Edit/5
// To protect from overposting attacks, please enable the specific properties you want to bind to, for
// more details see http://go.microsoft.com/fwlink/?LinkId=317598.
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Edit([Bind("IdSociedad,Sigla,Nombre,IdPais")] Sociedad sociedad)
{
if (ModelState.IsValid)
{
await _sociedadAsyncRepository.UpdateAsync(sociedad);
return RedirectToAction(nameof(Index));
}
ViewData["IdPais"] = new SelectList(_paisRepository.ListAll(), "IdPais", "Nombre", sociedad.IdPais);
return View(sociedad);
} |
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Edit([Bind("IdSociedad,Sigla,Nombre,IdPais")] Sociedad sociedad)
{
if (ModelState.IsValid)
{
await _sociedadAsyncRepository.UpdateAsync(sociedad);
return RedirectToAction(nameof(Index));
}
ViewData["IdPais"] = new SelectList(_paisRepository.ListAll(), "IdPais", "Nombre", sociedad.IdPais);
return sociedad;
} |
function Failure(args){
console.log(args.error);
} |
<ejs-grid #grid='' [dataSource]='data' (actionFailure)='actionFailure($event)'>
....
</ejs-grid>
|
actionFailure(e: any): void {
console.log(e.error)
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.