Hi,
I want to change the order of a checked button client-side. This works, but after moving the button, it loses it's text.
This is my code:
When I change the _getSelectedButton function so that I call item.get_text() before returning it, it works fine:
Is this a bug or what else could cause this?
Thanks!
I want to change the order of a checked button client-side. This works, but after moving the button, it loses it's text.
This is my code:
moveButtonRight:
function
() {
var
toolbar =
this
.get_radToolBar();
toolbar.trackChanges();
var
button =
this
._getSelectedButton();
var
index = toolbar.get_items().indexOf(button);
if
(index < toolbar.get_items().get_count() - 1) {
toolbar.get_items().removeAt(index);
toolbar.get_items().insert(index + 1, button);
}
toolbar.commitChanges();
},
_getSelectedButton:
function
() {
var
toolbar =
this
.get_radToolBar();
var
itemCount = toolbar.get_items().get_count();
for
(
var
i = 0; i < itemCount; i++) {
var
item = toolbar.get_items().getItem(i);
if
(item.constructor.getName() ==
"Telerik.Web.UI.RadToolBarButton"
&& item.get_checked()) {
return
item;
}
}
return
null
;
}
When I change the _getSelectedButton function so that I call item.get_text() before returning it, it works fine:
_getSelectedButton:
function
() {
var
toolbar =
this
.get_radToolBar();
var
itemCount = toolbar.get_items().get_count();
for
(
var
i = 0; i < itemCount; i++) {
var
item = toolbar.get_items().getItem(i);
if
(item.constructor.getName() ==
"Telerik.Web.UI.RadToolBarButton"
&& item.get_checked()) {
item.get_text();
return
item;
}
}
return
null
;
}
Is this a bug or what else could cause this?
Thanks!