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
checkboxes in inline editing can't be unchecked in jQuery 1.6.3 and 1.6.4
14/09/2011
18:48
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello Tony,

The answer described one havy problem in the usage of checkboxes. The line 133 (in the version 4.1.2) of the grid.inlinedit.js

tmp[nm]= $("input",this).attr("checked") ? cbv[0] : cbv[1];

set always cbv[0] value (checked) in tmp[nm]. The corresponding HTML fragment of $("input",this) is (at least in IE9):

<input id="18_IsInactive" class="editable" role="checkbox" name="IsInactive"
       value="1" CHECKED="" type="checkbox" offval="0">

If one replace the line to

tmp[nm] = $("input",this)[0].checked ? cbv[0] : cbv[1];

the problem will be fixed.

Additionally to the fix I recommend you to examine other places where checkboxes are used. There are many places where one use in the code

.attr("checked",false)

instead of

.removeAttr("checked")

Moreover the usage of checked property for verifing whether the checkbox is checked seems to me the most safe way.

I suppose that close problem could be in the usage of "selected" attribute of select boxes.

Best regards
Oleg 

16/09/2011
17:08
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Oleg,

As always thank you.

We need not to fix this one, but all the jqGrid Code,(this will be done if attr jQuery function is not changed in the next release Wink )

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.

16/09/2011
19:16
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello Tony,

if jqGrid has the problem with two last recent versions of jQuery 1.6.3 and 1.6.4jqGrid have to be changed to fix the problem.

I am not so pessimistisch in the size of changes. The problem exists only in the parts of code where the data can be changed. So it is just some places in multiselect and editing.

For example in the form editing one have to fix the line 360

if($(this).attr("checked")) {

to

if (this.checked) {

The line in the inline editing I posted before. In grid.celledit.js the line 152

v = $("#"+iRow+"_"+nmjq,$t.rows[iRow]).attr("checked") ? cbv[0] : cbv[1];

have to be changed to

v = $("#"+iRow+"_"+nmjq,$t.rows[iRow])[0].checked ? cbv[0] : cbv[1];

The three places are the most important places for the editing. By the way I have tested just now that the problem in form editing really exist.

The problem in multiselect can not been see at all. One uses in the line 2094 of grid.base.js already checked DOM property, so it can be that other places will do work.

Nevertheless I would be on your place rewote all places where the code like .attr("checked",false) or .attr("checked",true) are used. I would use only .attr("checked","checked") and .removeAttr("checked").

In any way the three placed (one place for one editing mode) should be changed as soon as possible.

Best regards
Oleg

P.S. By the way as the milestone to fix the problem is set 1.7 (see here)

18/09/2011
12:15
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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

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