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_TopicIcon
editrules during inlinedit
24/10/2008
10:05
Avatar
sledge
Member
Members
Forum Posts: 28
Member Since:
07/04/2008
sp_UserOfflineSmall Offline

Hello!

I came across the need to perform validation after Enter is pressed during inline edit mode.

I was surprised that this functionality is not yet working: i.e. displaying the same validation messages (or the first one), that of formedit, in an alert() box of an inlinedit case.

Maybe someone has already written such patch and would like to share so I would not be inventing a bike here?..

Thank you for revealing out the status of this part.

--
sledge

25/10/2008
06:47
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Yes you are right. I'm at the crossroads. Inline editing module should be

rewriten entirely.

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.

27/10/2008
10:00
Avatar
sledge
Member
Members
Forum Posts: 28
Member Since:
07/04/2008
sp_UserOfflineSmall Offline

Soo, are you rewriting it/will be rewriting it, or can I take a peep?

--
sledge

29/10/2008
02:53
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

No - I do not rewrite these, but definitley will apply the editrules.

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.

27/11/2008
08:21
Avatar
sledge
Member
Members
Forum Posts: 28
Member Since:
07/04/2008
sp_UserOfflineSmall Offline

Hi!

It is very important: when could I expect the inline editing editrules working?

Otherwise I would start learning JS and a huge trial-error path ahead..

Thanks a pint!

--
sledge

27/11/2008
12:06
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

To be a honest I do not know. Currently I'm little busy with other

project. Actually I must work - you know why.

Instead I will try to do this for 3.4 version (see Roadmap) and

not for the upcomming bug fix release.

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/12/2008
08:15
Avatar
sledge
Member
Members
Forum Posts: 28
Member Since:
07/04/2008
sp_UserOfflineSmall Offline

Hello, Tony and all,

Here is my contribution to the project: the working inline edit editrules validation. It colors the non-validating input text controls with pink color and alerts with the list of errors. Once alert dismissed, it focuses the caret onto the first erroneous control.
It does not proceed to post until all errors are corrected.

Enjoy and welcome any feedback. (note the commented info_dialog, due to such visualizing, the .focus() does not work afterwards).

I will improve it to validate also other type of controls (i.e. select :)) when my boss asks for it hehe 🙂

*** /.../jqGrid-3.3.1/js/grid.inlinedit.js        2008-10-14 19:06:22.000000000 +0200
--- grid.inlinedit.js   2008-12-09 14:55:51.000000000 +0100
***************
*** 63,68 ****
--- 63,75 ----
                editable = $('#'+rowid,$t.grid.bDiv).attr("editable");
                url = url ? url : $t.p.editurl;
                if (editable==="1" && url) {
+                       // leleiva: inline editrules
+                       var ret=[true,"",new Array()];
+                       var first_error;
+                               // all depend on ret array
+                       //ret[0] - success
+                       //ret[1] - msg if not success
+                       //ret[2] - the ids of erronous controls that will be colored pink
                        $('#'+rowid+" td",$t.grid.bDiv).each(function(i) {
                                nm = $t.p.colModel[i].name;
                                if ( nm !== 'cb' && nm !== 'subgrid' && $t.p.colModel[i].editable===true) {
***************
*** 88,98 ****
                                                                }
                                                                break;
                                                }
                                        }
                                }
                        });
                        if(tmp) { tmp["id"] = rowid; if(extraparam) { $.extend(tmp,extraparam);} }
!                       if(!$t.grid.hDiv.loading) {
                                $t.grid.hDiv.loading = true;
                                $("div.loading",$t.grid.hDiv).fadeIn("fast");
                                $.ajax({url:url,
--- 95,131 ----
                                                                }
                                                                break;
                                                }
+                                               // leleiva: inline editrules
+                                               switch ($t.p.colModel[i].edittype) {
+                                                       case "password":
+                                                       case "text":
+                                                       case "textarea":
+                                                               ret_once = checkValues($("input, select>option:selected, textarea",this).val(),i,$t);
+                                                               if (!ret_once[0]) {
+                                                                       ret[0] = false;
+                                                                       ret[1] += ret_once[1] + "\\n"; // + "<br>";
+                                                                       $("input, select>option:selected, textarea",this).css({backgroundColor: "pink"});
+                                                                       if (first_error == null)
+                                                                               first_error = $("input, select>option:selected, textarea",this);
+                                                               } else {
+                                                                       $("input, select>option:selected, textarea",this).css({backgroundColor: ""});
+                                                               } 
+                                                               break;
+                                               }
                                        }
                                }
                        });
+                       if(!ret[0]) {
+                               try {
+                                       alert(ret[1]);
+                                       first_error.focus();
+ //                                    window.setTimeout(function(){
+ //                                              info_dialog($.jgrid.errors.errcap,ret[1],$.jgrid.edit.bClose, $t.p.imgpath);
+ //                                            },0);
+                               } catch (e) {}
+                       }
                        if(tmp) { tmp["id"] = rowid; if(extraparam) { $.extend(tmp,extraparam);} }
!                       if(!$t.grid.hDiv.loading && ret[0]) {
                                $t.grid.hDiv.loading = true;
                                $("div.loading",$t.grid.hDiv).fadeIn("fast");

09/12/2008
08:25
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

You can send me the code to tony at trirand dot com.

Thank you

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.

14/12/2008
08:39
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Your addition will be added in the next release. I need to perform some

additional test.

Thank you

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:
34 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