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

[Solved] IE9 Checkbox issue

0 Answers 101 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Chris
Top achievements
Rank 1
Chris asked on 27 Jan 2012, 12:26 PM
Hi,

I have a treeview checkbox issue with IE9 only (it's fine with Chrome, Firefox and IE8).

In my Razor page declaration I'm adding the following two lines in the tree setup:

.ShowCheckBox(true)
.ClientEvents(events => events.OnChecked("onTreeCheckboxTick"))


The client side click event handler is then:

function onTreeCheckboxTick(e) {
    if (e.checked) {
        addColumnToGrid($(e).closest('.t-item'));
    }
    else {
        removeColumnFromGrid($(e).closest('.t-item'), true);
    }
}


I have a Telerik MVC Grid on the same page as the tree and whenever you tick an item in the tree it adds a row to the grid with the text of the tree item in.  If you untick an item in the tree it removes the row that was added (the adding/removing is done completely client side via the DOM using jQuery but that shouldn't be affecting it in any way - it's not going back to the controller).

In Chrome, Firefox and IE8 if you click a tickbox twice in fast succession the grid row will be quickly added and then removed straight away (i.e. it's hit the 'if' in the click handler first and then it hits the 'else' in the click handler).

However, in IE9 if you do the same it's hitting the 'if' in the click handler both times - i.e. after the first tick, it goes back into the handler and doesn't think it's ticked so does the same again.  This results in the text in the tree being added twice to the grid in two successive rows.

Has this been seen before and how can it be solved?

Thanks

Tags
TreeView
Asked by
Chris
Top achievements
Rank 1
Share this question
or