Solved

Need to use jQuery to toggle this jqGrid checkbox

Posted on 2011-09-20
6
1,193 Views
Last Modified: 2012-05-12
I have the following code which I need to understand, then be able to toggle the checbox to unchecked.  I don't understand how at the same time there can be a filter, a return value, hiding and adding attributes, and WAI-ARIA support to boot.

So when I need to make the checkbox unchecked, I am confused.
I have not yet read about the t3() function, so a little explanation of that may help.

$("span[t3parent=global_select]", $("#mydata tr.jqgrow").filter(function (index) {
return $("td[aria-describedby=mydata_PermitAccess][title=true]", this).length == 0;
}).hide().attr("directaccess", "no")).attr("t3parent", "root");

So I need to do all this AND toggle the checkbox to unchecked.

Any help or explanation would be appreciated.

Thanks!
0
Comment
Question by:newbieweb
  • 3
  • 3
6 Comments
 
LVL 40

Expert Comment

by:gurvinder372
ID: 36571613
what is the checkbox id or the class?
Is there a reference to checkbox object in the code above?
0
 

Author Comment

by:newbieweb
ID: 36572060
No. I do not think so in that code above. But I started to write the following after drilling down with Firebug and was told I was "getting close" after writing the following:

$("td a.checkbox[aria-describedby=mydata_PermitAccess][title=true]").attr("checkbox", "unchecked");

I think my problem was here: attr("checkbox", "unchecked");

I wasn't sure of the syntax for the attr() function and think I do indeed need to find how to reference the class there. Not sure how...
0
 
LVL 40

Accepted Solution

by:
gurvinder372 earned 500 total points
ID: 36572172
check this one

$("td a.checkbox[aria-describedby=mydata_PermitAccess][title=true]").each(function(){
  if($(this).is(":checked"))
  {
     $(this).removeAttr("checked");
  }
});

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:newbieweb
ID: 36572208
Great. But where do I fit in the initial code in this post? I get confused by the return value, etc.
0
 
LVL 40

Expert Comment

by:gurvinder372
ID: 36572228
i have only modified the code given in your previous comment
0
 

Author Closing Comment

by:newbieweb
ID: 36572748
Thanks for the help!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now