Forum



21:21

30/10/2008

Hi Tony and others,
I am finding this solution:
User edit inline row. After press key 'enter' I need validate data on server side. If will error thrown row don't save and user will be noticed (by js alert for example). Row will stay as was filled in and user can repair data and send them again.
I think, there are two solutions
1) Server throw error http response code (for example 403). I must handle this error over 'errorfunc' defined in editRow. But after errorfunc user can't send data to server again. There is my not complete working solution http://sandbox.jipas.cz/jqgrid/
2) Server throw some JSON for example and I will handle data, but I don't know how.
Can anybody kick me? Thanks
15:56

Moderators
30/10/2007

Hello,
Thanks.
1) This is a bug. In this case we should call a restoreRow to restore the data and make the row again editable.
The problem is fixed.
2) You can use a succesfunc - to this function we pass the response.
Note that since we use a jQuery complete event in ajax you should parse your JSON response something like
function mysuccces(res)
{
myjson = $.jgrid.parse(res.responseText);
// now you have what you want
}
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
12:32

30/10/2008

tony said:
2) You can use a succesfunc - to this function we pass the response.
Note that since we use a jQuery complete event in ajax you should parse your JSON response something like
function mysuccces(res)
{
myjson = $.jgrid.parse(res.responseText);
// now you have what you want
}
Regards
Tony
Hi Tony,
thanks for kick me to right direction. 🙂
Now I am using aftersavefunc for handle response. It's works almost right, but one problem is here. For example I do this like user:
1) Edit grid row
2) I change some data for example 'Client 1' to 'Client 2' and press ENTER
3) Grid throw error message because note field is not valid. (server side validate)
4) Grid row is in edit mode again.
5) I will not repair data and leave editing grid (press ESC)
6) In afterrestorefunc is $('#grid').trigger('reloadGrid'); I need get actual data from server, but this throw error in Firebug and request is not send.
Do you know how solve this?
May be there is other better solution. I don't know.
You can see and try it at http://sandbox.jipas.cz/jqgrid/
Thanks for help me
Regards czita
13:54

Moderators
30/10/2007

HEllo,
Could you please include the development version in order to see what is happen.
Thanks.
Best Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
42 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66