This is a migrated thread and some comments may be shown as answers.

[Solved] Batch editing and multiple columns with checkbox

0 Answers 30 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dana
Top achievements
Rank 1
Dana asked on 20 Aug 2012, 08:07 AM
Hello,

I am trying to figure out a way to work with batch editing and two columns with checkboxes.
I am trying to implement the following scenario: 
if one checkbox on the row is checked, uncheck the other checkbox if checked (like radiobuttons).

I have managed to do that at an interface level, but the value behind the cell is still unchanged.
This is the function for that:
function onLoad1(e) {
            $('td', this).live('click', function (e) {
                var index = this.cellIndex;
                $('tr.t-grid-edit-row').each(function () {     
            var isChecked= $(this).find('td.t-grid-edit-cell input:checkbox').is(":checked");          
                    var tdClicked = $(this).find('td.t-grid-edit-cell');                   
                    if (isChecked) {
                        var toUncheck= $(this).find('td input:checkbox').each(function () {
                            var unchecking= $(this).removeAttr("checked");
                        });
                        var toCheck= $(this).find('td.t-grid-edit-cell input:checkbox');
                        var checkingIt= toCheck.attr("checked", isChecked);
                    }
                });
            });        
        }


How to access the value behing the checkbox in order to modify it on checking the other checkbox.

Thank you!
Tags
Grid
Asked by
Dana
Top achievements
Rank 1
Share this question
or