如何全局设定FormElement的labelSeparator属性
发布网友
发布时间:2022-05-16 20:46
我来回答
共2个回答
懂视网
时间:2022-05-17 01:07
function flushDataTree()
{
dataset_mainMenuTemp.setShowLoadingTip(true);
var rootNode = tree_Menu.getFirstRootNode();
tree_Menu.setCurrentNode(rootNode);
tree_Menu.expandNode(rootNode);
dataset_mainMenu.clearData();
dataset_mainMenuTemp.flushData();
dataset_mainMenuTemp.flushDataAsync(function(succeed)
{
if (!succeed) return;
dataset_mainMenuTemp.disableControls();
try {
dataset_mainMenuTemp.moveFirst();
while (!dataset_mainMenuTemp.isLast())
{
var record=dataset_mainMenuTemp.getCurrent();
var node = new RecordTreeNode(record, rootNode.getTreeLevel().getTreeLevel("level_menu"));
rootNode.addNode(node);
dataset_mainMenuTemp.moveNext();
}
}catch(e)
{
alert(e.message);
}
finally {
dataset_mainMenuTemp.enableControls();
flushThirdLevelNode();
}
});
}
function flushThirdLevelNode(){
try {
dataset_myMailBox.parameters().setValue("myBoxCoding","box03");
dataset_myMailBox.flushData();
//将当前节点展开
var currentNode=getCurrentNodeNum(3);
tree_Menu.expandNode(currentNode);
//向dataset中新增一条节点数据
dataset_myMailBox.disableControls();
dataset_myMailBox.moveFirst();
while (!dataset_myMailBox.isLast())
{
record=dataset_myMailBox.getCurrent();
var node = new RecordTreeNode(record, currentNode.getTreeLevel().getTreeLevel("level_myMailBox"));
//新增节点
currentNode.addNode(node);
dataset_myMailBox.moveNext();
}
}catch(e)
{
alert(e.message);
} finally {
dataset_myMailBox.enableControls();
}
}
热心网友
时间:2022-05-16 22:15
有两种解决方式:
1.纯js的方法,写一个公用的js方法,并把该js文件打包到common包下。因为common包是全局的,所有view文件都会加载。
在FormElement初始化之前设置labelSeparator为空的js方法:
dorado.beforeInit(function(){
if (dorado.widget.FormElement) {
dorado.widget.FormElement.prototype.ATTRIBUTES.labelSeparator.defaultValue = "";
}
});
把js文件配置到dorado-home目录下的packages-config.xml中的属性名为common的package中:
<Package name="common" pattern="js" baseUri=">libraries/global">
/libraries/global/globalFunction
</Package>