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

[Solved] Checkbox - Uncheck based on a confimration

0 Answers 6 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.
Martin
Top achievements
Rank 1
Martin asked on 03 Aug 2012, 03:46 PM
I have a checkbox contained with a Telerik grid defined as follows:

            columns.Bound(o => o.ActiveInd)
                        .ClientTemplate("<input type='checkbox' name='Active' title='Active' <#= ActiveInd ? checked='checked':' ' #>/>")
                        .Width(50)
                        .HtmlAttributes(new { style = "text-align:center" });

I have then created a JQuery delegate to handle when this checkbox is clicked/changed:

             $("#gWatchlists").delegate(":checkbox"'click'function (e) {
                var isChecked = $(this).is(":checked");
                alert(isChecked);
                if (!isChecked) {
                    if (confirm("Are you sure you wish to deactivate this watchlist?") == false) {
                        //$(this).prop("checked", true);
 
                       //$(this).attr('checked', 'checked');
                    }
                }             
                });

The event fires without a problem BUT what i want to do is re-check the checkbox IF the user cancels the confirm dialog,
I have not had much success in doing this.

Can someone please point me in the right direction.
Tags
Grid
Asked by
Martin
Top achievements
Rank 1
Share this question
or