Andy Green
asked on
Checkbox in a grid (part 2)
I asked and got an excellent respose to this question the other day here:
https://www.experts-exchange.com/questions/28082406/Checkbox-in-a-grid-how-to-identify-on-the-client.html
I have to expand this, and its doing my head in.
In each row of a grid (a Rad Grid) I have the following:
checkboxL CheckboxR Textbox CheckboxPri CheckboxSec
What I'm trying to do using the code previously provided it to do this:
1. If either the L or R check boxes are ticked then the checkboxSec is also ticked row changes colour
2. If checkboxPri is ticked the checkBoxSec is also ticked ( this was the original question) row changes colour
3. If any other CheckBoxPri is ticked then the previous checkboxPri is unticked but leaves the CheckboxSec ticked. I'm doing thsi OK with an on click event
4. if CheckbocSec is unticked all checkboxes are cleared as is any text in the text box, row colour is removed.
I appreciate this is a lot of work, but any pointers would be brilliant.
Andy
https://www.experts-exchange.com/questions/28082406/Checkbox-in-a-grid-how-to-identify-on-the-client.html
I have to expand this, and its doing my head in.
In each row of a grid (a Rad Grid) I have the following:
checkboxL CheckboxR Textbox CheckboxPri CheckboxSec
What I'm trying to do using the code previously provided it to do this:
1. If either the L or R check boxes are ticked then the checkboxSec is also ticked row changes colour
2. If checkboxPri is ticked the checkBoxSec is also ticked ( this was the original question) row changes colour
3. If any other CheckBoxPri is ticked then the previous checkboxPri is unticked but leaves the CheckboxSec ticked. I'm doing thsi OK with an on click event
4. if CheckbocSec is unticked all checkboxes are cleared as is any text in the text box, row colour is removed.
I appreciate this is a lot of work, but any pointers would be brilliant.
Andy
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<|:-)
ASKER
Hi Zvonko
Thanks again for this its superb and I've learnt a lot from the logic of it.
One issue, when you first click the secondary the row doesn't change colour.
I have added the line setRowColor(theBox, "lightgray"); to the setSecondaryProcedure and the row changes colour when its deselecting the row (4 above)
I have debugged the code and the setSecondaryProcedure isn't being hit on the first click, only the second (this deselects).
Any ideas
Andy
Thanks again for this its superb and I've learnt a lot from the logic of it.
One issue, when you first click the secondary the row doesn't change colour.
I have added the line setRowColor(theBox, "lightgray"); to the setSecondaryProcedure and the row changes colour when its deselecting the row (4 above)
I have debugged the code and the setSecondaryProcedure isn't being hit on the first click, only the second (this deselects).
Any ideas
Andy
ASKER
Hi
Ignore that last post, I have sorted it. I missed the If !thebox, by adding an else to change the row colour it now works.
Andy
Ignore that last post, I have sorted it. I missed the If !thebox, by adding an else to change the row colour it now works.
Andy
ASKER
Just excellent. Thank you.
Andy
Andy
ASKER
Hi
Actually there is one issue.
I have this script after the one you supplied and with your scripts this doesn't work any more. It forces a couple of buttons to the bottom of the page like a to top button, and they scroll with the page.
//Does the cool button stuff
$(document).ready(function () {
//Save area
$('a.CoolBit').click(funct ion (e) {
$('html, body').animate({ scrollTop: 0 }, 'slow');
e.preventDefault();
});
$(window).load(function () {
$('.CoolBit').slideDown('s low');
});
I get the error Unable to get document ready of undefined or null reference at this line - $(document).ready(function () {
Andy
Actually there is one issue.
I have this script after the one you supplied and with your scripts this doesn't work any more. It forces a couple of buttons to the bottom of the page like a to top button, and they scroll with the page.
//Does the cool button stuff
$(document).ready(function
//Save area
$('a.CoolBit').click(funct
$('html, body').animate({ scrollTop: 0 }, 'slow');
e.preventDefault();
});
$(window).load(function () {
$('.CoolBit').slideDown('s
});
I get the error Unable to get document ready of undefined or null reference at this line - $(document).ready(function
Andy
ASKER
I've done a bit more investigating as some validation scripts stopped working, and its this that's causing the trouble
function $(theId) {
return document.getElementById(th eId);
}
Any ideas?
Andy
function $(theId) {
return document.getElementById(th
}
Any ideas?
Andy
Sorrs, you have to REMOVE my version of the upper function.
My upper version overwrites some function that your grid imports from elsewhere, you see?
My upper version overwrites some function that your grid imports from elsewhere, you see?
ASKER
If I remove this function the functionality stops working, for example if you select Primary then Secondary isn't automatically clicked.
Andy
Andy
ASKER
Fantastic - worked brilliantly. Did you see my email?
Andy
Andy
Yes, I got your email.
ASKER
Andy