更新时 Radlistbox 文本不呈现
我在 OnClientReordered 事件中调用了以下 javascript。我试图在重新排序时更改列表中项目的文本。我看到的是该项目在事件第一次触发时不会更新。第二次触发该事件时,文本将正确呈现。 (文本正在正确更改,因为我可以对值进行监视,并且文本是正确的。它只是没有被渲染)我在这里做错了什么吗?我在 API 文档中找不到任何信息。
function SetcontentorderNumber() {
reg = new RegExp("\\[\\d*\\]")
var list = $find("<%= foo.ClientID %>");
var length = list.get_items().get_count();
list.trackChanges();
for (var i = 0; i < length; i++) {
var text = list.getItem(i).get_text();
if (reg.test(text)) {
texttext = text.replace(reg, "[" + (i + 1) + "] ");
list.getItem(i).set_text(text);
}
else {
text = "[" + (i + 1) + "] " + text;
list.getItem(i).set_text(text);
}
}
list.commitChanges();
}
I have the following javascript that is being called in the OnClientReordered event. I am trying to change the text of the items in the list when they are reordered. What I am seeing is the item does not update the first time the event fires. The second time the event fires the text gets rendered correctly. (The text is being changed properly, as I can put a watch on the values, and the text is correct. It is just not being rendered) Is there something I am doing incorrectly here? I could find no information from the documentation on the API.
function SetcontentorderNumber() {
reg = new RegExp("\\[\\d*\\]")
var list = $find("<%= foo.ClientID %>");
var length = list.get_items().get_count();
list.trackChanges();
for (var i = 0; i < length; i++) {
var text = list.getItem(i).get_text();
if (reg.test(text)) {
texttext = text.replace(reg, "[" + (i + 1) + "] ");
list.getItem(i).set_text(text);
}
else {
text = "[" + (i + 1) + "] " + text;
list.getItem(i).set_text(text);
}
}
list.commitChanges();
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是我们使用 2009 年第 3 季度 ajax 控件的版本的问题。我在一个使用最新版本控件的项目中尝试了这一点,效果很好。
This was an issue with the version we were using Q3 2009 of the ajax controls. I tried this out on a project using the newest version of the controls and it worked fine.