문제

I need to disable all checkboxes that I have in telerik RadTree. How I could achieve that?

Trick is, these are not HTML controls but seem to be something imitating these via images, CSS and javascript. For instance, HTML for a RadTreeView node looks like:

  <div class="rtMid">
  <span class="rtSp"></span>
  <span class="rtMinus"></span>
  <span class="rtUnchecked"></span>
  <span class="rtIn">Item text</span>
  </div> 

Best, Askar

도움이 되었습니까?

해결책

Simply redefine its onclick javascript event so it doesn't fire.

This is supposed to work in every browser:

onclickEvent = "if (event.cancelable) {event.preventDefault();}else {event.returnValue = false;} return false;";

This is what I think is the best cross-browser solution:

onclickEvent = "this.checked = !this.checked;";
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top