EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
June 15, 2024, 07:38:10 PM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
EasyUI for jQuery
>
Server database processing no validation hook for edatagrid extension
Pages: [
1
]
« previous
next »
Print
Author
Topic: Server database processing no validation hook for edatagrid extension (Read 13060 times)
frapa02
Newbie
Posts: 6
Server database processing no validation hook for edatagrid extension
«
on:
January 06, 2012, 06:07:56 AM »
There appears to be no facility in the edatagrid plugin server call to check for a response from the server program which performs the database processing. I have worked around the problem for the get data by passing any error messages into one of the grid fields. However, I need something to allow me to return details to the user properly if there was a problem in the server processing. This is available in the normal datagrid and form approach. Adding this will be very important for live data interfaces. I should be able to figure out how to change the plugin but if anyone has any thoughts or suggestions please let me know.
For example, for updates / inserts we need to add some code to test the returned data after line 34 in jquery.edatagrid.js:
$.post(url, row, function(data){
Paul.
Logged
tclemmer
Newbie
Posts: 1
Re: Server database processing no validation hook for edatagrid extension
«
Reply #1 on:
April 25, 2012, 10:46:36 AM »
I am not a very capable javascript programmer but here is what we added.
Add this after the line "data.isNewRecord = null;" in the onAfterEdit section
if(data.error_message != ""){process_table_error(data.error_message)};
This requires you to make sure that first element in your returned JSON is "error_message" with a value of "" for now error. If you have an error, pass "error_message" with the value of your error message.
Then in your javascript section of your page add:
function process_table_error(error_msg){
$.messager.alert('Error',error_msg);
}
I know it is primitive but it is working form me at the moment.
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...