aam82 Posted March 17, 2016 Report Share Posted March 17, 2016 I can't figure out a javascript to disable this checkbox, to the left of the Yes group. The script must check for Yes, because sometimes only the (blank) group exists, and sometimes only (blank) and Yes, and sometimes (blank) No and Yes. Can't use CSS as far as I can tell. The goal is to prevent the mass-selection of Yes records. I tried using some javascript browser addons to find an appropriate selector, but was my first time using and no luck. I also tried using .prev() in jQuery, but now I don't think the checkbox is a sibling. I tried modifying the code used to conditionally format rows, but those are inserted into HTML blocks for records, and so can't operate on Group rows. Thanks in advance! Quote Link to comment Share on other sites More sharing options...
aam82 Posted March 17, 2016 Author Report Share Posted March 17, 2016 forgot to add that I'm already blocking the select all box at the top with CSS! Quote Link to comment Share on other sites More sharing options...
LWSChad Posted March 18, 2016 Report Share Posted March 18, 2016 forgot to add that I'm already blocking the select all box at the top with CSS! What code are you using for this? What is the address of this page; if I can see the source code I can help you figure it out Quote Link to comment Share on other sites More sharing options...
aam82 Posted March 18, 2016 Author Report Share Posted March 18, 2016 thanks, I PM'd you. Quote Link to comment Share on other sites More sharing options...
LWSChad Posted March 21, 2016 Report Share Posted March 21, 2016 Now, I understand what you meant by The script must check for Yes, because sometimes only the (blank) group exists, and sometimes only (blank) and Yes, and sometimes (blank) No and Yes. Can't use CSS as far as I can tell. You mean it won't always be in the same position, relative to counting the number of elements. You could fix that if you put yes, on top and make it always show,,, even if there aren't records in yes. This hides the checkbox next to "no", and if you put yes there, you can get what you're after. tr[data-cb-name="group1"]:nth-child(2) input[type="checkbox"] { display: none; } I think this might require jQuery Quote Link to comment Share on other sites More sharing options...
aam82 Posted March 21, 2016 Author Report Share Posted March 21, 2016 That's clever, I hadn't thought of that, but I'm dealing with users who: need to see blank/No more importantly than Yes. I don't want blank/No "below the fold" are used to seeing it the other way aren't savvy complain a lot Quote Link to comment Share on other sites More sharing options...
aam82 Posted March 21, 2016 Author Report Share Posted March 21, 2016 I think I got it. This works in a footer element HTML block (so that it runs after AJAX updates, instead of just once) when the column with data matching Yes is the first column following the checkbox. <SCRIPT LANGUAGE="JavaScript"> var elems = document.getElementsByTagName("td"); for (var i=0, m=elems.length; i<m; i++) { if (elems.innerHTML=="Yes") { elems.previousSibling.style.display="none";} } </SCRIPT> edit: if you have other data that might =Yes, then you might have to modify this. In my case, Yes can only appear in the one place that I'm targetting. Quote Link to comment Share on other sites More sharing options...
LWSChad Posted March 22, 2016 Report Share Posted March 22, 2016 Nice work, that isn't simple js. That's clever, I hadn't thought of that, but I'm dealing with users who: need to see blank/No more importantly than Yes. I don't want blank/No "below the fold" are used to seeing it the other way aren't savvy complain a lot Most users my friend. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.