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
Patch for: unable to edit row, where rowid is empty string.
11/11/2010
15:41
Avatar
szhbug
Member
Members
Forum Posts: 7
Member Since:
24/04/2010
sp_UserOfflineSmall Offline

When rowid is empty string, jqgrid does not allow edit or view row, due to wrong checks for rowid.

However with the following fix (check for rowid==null instead of !rowid), it works, and send correct data to server.

Warning message "Please, select row"  still appears, I havent found where to fix that.

--- grid.formedit.js.old    2010-11-11 14:59:12.000000000 +0200
+++ grid.formedit.js    2010-11-11 15:18:21.000000000 +0200
@@ -324,11 +324,11 @@
             viewPagerButtons : true
         }, $.jgrid.edit, p || {});
         rp_ge = p;
         return this.each(function(){
             var $t = this;
-            if (!$t.grid || !rowid) { return; }
+            if (!$t.grid || rowid==null) { return; }
             var gID = $t.p.id,
             frmgr = "FrmGrid_"+gID,frmtb = "TblGrid_"+gID,
             IDs = {themodal:'editmod'+gID,modalhead:'edithd'+gID,modalcontent:'editcnt'+gID, scrollelm : frmgr},
             onBeforeShow = $.isFunction(rp_ge.beforeShowForm) ? rp_ge.beforeShowForm : false,
             onAfterShow = $.isFunction(rp_ge.afterShowForm) ? rp_ge.afterShowForm : false,
@@ -1070,11 +1070,11 @@
             beforeShowForm : null,
             viewPagerButtons : true
         }, $.jgrid.view, p || {});
         return this.each(function(){
             var $t = this;
-            if (!$t.grid || !rowid) { return; }
+            if (!$t.grid || rowid==null) { return; }
             if(!p.imgpath) { p.imgpath= $t.p.imgpath; }
             // I hate to rewrite code, but ...
             var gID = $t.p.id,
             frmgr = "ViewGrid_"+gID , frmtb = "ViewTbl_"+gID,
             IDs = {themodal:'viewmod'+gID,modalhead:'viewhd'+gID,modalcontent:'viewcnt'+gID, scrollelm : frmgr},

17/11/2010
19:06
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Thanks for the first, I think that we should not allow a row with id = empty string. Indeed I think that

we should chek it for undefined instead of something elese.

About this:

Warning message "Please, select row"  still appears, I havent found where to fix that.

Please check if you have the needed css loaded correctley. Please see the diffrenece between developer and runtime installation

http://www.trirand.com/jqgridw.....to_install

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/2010
14:11
Avatar
szhbug
Member
Members
Forum Posts: 7
Member Since:
24/04/2010
sp_UserOfflineSmall Offline

tony said:

Hello,

Thanks for the first, I think that we should not allow a row with id = empty string.


Decision of what is allowed in application data should not be made at a library level, it should be made in application level, based on application logic and data, which is unknown for the library. Most application will not produce non-english characters as a key, thats fine, but for those that do, they need to decide themselves, based on application logic, what is allowed. Library should handle any keys, with the only valid restriction for the library level - demand that the keys are unique in a table.

For example for my application empty string is a valid key in some tables, and whether such row exists - depends on the data, received from external sources. It is not a user input.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
32 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