Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Controlar errores $jTableResult['Result'] #2274

Open
cogare84 opened this issue Apr 6, 2022 · 1 comment
Open

Controlar errores $jTableResult['Result'] #2274

cogare84 opened this issue Apr 6, 2022 · 1 comment

Comments

@cogare84
Copy link

cogare84 commented Apr 6, 2022

Hola.
Quisiera saber como puedo controlar cuando da algún error la carga del objeto jtable.
El caso es que si se produce un error en el controlador, hago lo siguiente:
$jTableResult['Result'] ='error';
pero luego como puedo controlar dicho resultado en la parte donde cargo el div que contiene el objeto jtable?
Gracias de antemano y un saludo.

@misterparsons
Copy link

Hello,

Jtable processes the server response for you.

If there is an infrastructure problem there will be an HTTP failure, or if jtable does not recognise the response, jtable will show an Alert with "An error occured while communicating to the server."

If your controller completes normally, but recognises it cannot perform the jtable request, it must return a json response {"Result":"ERROR","Message":"your message to your user"}

JTable will then show this message in an Alert box

Note. ERROR must be uppercase.

Goog Luck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants