Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
Server validating data + error warning
03/06/2010
21:21
Avatar
czita
Member
Members
Forum Posts: 9
Member Since:
30/10/2008
sp_UserOfflineSmall Offline

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. Smile

Can anybody kick me? Wink Thanks

08/06/2010
15:56
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

09/06/2010
12:32
Avatar
czita
Member
Members
Forum Posts: 9
Member Since:
30/10/2008
sp_UserOfflineSmall Offline

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

16/06/2010
13:54
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
39 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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information