用delete删除XML和XMLListCollection的节点
来源:互联网 发布:mysql 时间序列 编辑:程序博客网 时间:2024/06/05 11:33
Problem Summary
simply using the Delete key work in Flex does not work most of the time and if you have a Tree that's bound to the XMLListCollection Flex will mess up the Tree Selection after deleting an XML element.
Solution Summary
Use a custom method to for loop and delete proper child and reset tree selection
Explanation
Use this method:
private function xmlDeleteNode(xmlToDelete:XML):Boolean
{
var cn:XMLList = XMLList(xmlToDelete.parent()).children();
for ( var i:Number = 0 ; i < cn.length() ; i++ )
{
if ( cn[i] == xmlToDelete )
{
delete cn[i];
return true;
}
}
return false;
}
Also, remember to do on an XML Bound Tree Control:
myTree.selectedItem = null;
注:XMLList 不支持 delete
- 用delete删除XML和XMLListCollection的节点
- Flex--之XML、XMLLIST和XMLListCollection的关系和区别
- 删除链表的节点,关于delete和free
- XML,XMLList,XMLListCollection之间的关系笔记
- xml xmlList 与xmlListCollection的相互转换
- Flex基础-----之XML、XMLLIST和XMLListCollection的关系和区别
- Xml删除和创建节点
- List和XmlListCollection的数据绑定
- xml节点的删除出错
- AS3 的XML删除节点
- 删除指定的XML节点
- java对xml节点属性的添加和删除
- flex学习进度9之访问xml的XMLListCollection
- 一种不好的删除XML空白节点和注释节点的方法
- 删除和修改(替换)XML节点
- 批量删除XML节点失败的解决办法
- 批量删除XML节点失败的解决办法
- C# 删除指定的XML节点
- 一个函数,可以在输入密码时,不现实密码
- Struts 报错及其处理
- Eclipse插件开发时创建自己工程后实现刷新透视图
- filter的光辉贡献
- windows server2003 使用小技巧
- 用delete删除XML和XMLListCollection的节点
- 判断两个矩形是否有交集
- jdbcTemplate.queryXX 方法用法
- Js只能输入数字
- 解决Windows服务器蓝屏死机问题的工具——BlueScreenView
- 关于BCD码的编码和解码
- C# Regex.IsMatch (正则表达式验证:数字、小数点、邮件、计算表达式)
- delphi三层构架思想
- 项目进行中