提交 00d7df42 编写于 作者: U unknown

数据表格增加reload

上级 8bec06ac
......@@ -19,6 +19,13 @@
<input type="radio" name="isReadonly" value="true" text{($.isReadonly)?'checked':''}/>{{$.lp.yes}}
<input type="radio" name="isReadonly" value="false" text{(!$.isReadonly)?'checked':''}/>{{$.lp.no}}
</td>
</tr>
<tr>
<td class="editTableTitle">{{$.lp.newline}}:</td>
<td class="editTableValue">
<input type="radio" name="newline" value="true" text{($.newline)?'checked':''}/>{{$.lp.yes}}
<input type="radio" name="newline" value="false" text{(!$.newline)?'checked':''}/>{{$.lp.no}}
</td>
</tr>
<tr>
<td class="editTableTitle">{{$.lp.options}}:</td>
......
......@@ -3,7 +3,7 @@
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr>
<td class="editTableTitle">{{$.lp.id}}:</td>
<td class="editTableValue">text{$.id}</td>
<td class="editTableValue"><input type="text" name="id" value="text{$.id}" class="editTableInput"/></td>
</tr>
<tr>
<td class="editTableTitle">{{$.lp.name}}:</td>
......
......@@ -1252,6 +1252,7 @@ MWF.xApplication.process.FormDesigner.LP = {
"menuItem": "Menu Item",
"dropdownDefaultText": "Dropdown Menu",
"showButton": "Show Button",
"newline": "one line per option",
"wps" : {
"config":"Config",
......
......@@ -1258,6 +1258,7 @@ MWF.xApplication.process.FormDesigner.LP = {
"menuItem": "菜单项",
"dropdownDefaultText": "下拉菜单",
"showButton": "显示按钮",
"newline": "每个选项一行",
"wps" : {
"config":"配置",
......
......@@ -66,6 +66,7 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox = new Class(
"display": "inline"
}
});
if( this.json.newline )this.node.setStyle("display", "block");
this.setOptions();
},
_loadDomEvents: function(){
......@@ -165,19 +166,26 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox = new Class(
var text = tmps[0];
var value = tmps[1] || text;
var node;
if( this.json.newline ){
node = new Element("div").inject(this.node);
}else{
node = this.node;
}
var radio = new Element("input", {
"type": "checkbox",
"name": ((this.json.properties) ? this.json.properties.name : null) || flag+this.json.id,
"value": value,
"showText": text,
"styles": this.json.buttonStyles
}).inject(this.node);
}).inject(node);
//radio.appendText(text, "after");
var textNode = new Element( "span", {
"text" : text,
"styles" : { "cursor" : "default" }
}).inject(this.node);
}).inject(node);
textNode.addEvent("click", function( ev ){
if( this.radio.get("disabled") === true || this.radio.get("disabled") === "true" )return;
this.radio.checked = ! this.radio.checked;
......
......@@ -241,6 +241,29 @@ MWF.xApplication.process.Xform.DatatablePC = new Class(
this.loadDatatable();
},
reload: function(){
this.reloading = true;
var tr = this.titleTr;
var node;
if( tr ){
var node = tr.getElement("th.mwf_addlineaction");
if( node )node.destroy();
node = tr.getElement("th.mwf_moveaction");
if( node )node.destroy();
}
tr = this.templateTr;
if( tr ){
node = tr.getElement("td.mwf_editaction");
if( node )node.destroy();
node = tr.getElement("td.mwf_moveaction");
if( node )node.destroy();
}
this.clearSubModules();
this.loadDatatable();
this.reloading = false;
},
loadDatatable: function(){
this._loadStyles();
......@@ -275,14 +298,18 @@ MWF.xApplication.process.Xform.DatatablePC = new Class(
if (json){
var module = this.form._loadModule(json, th);
this.form.modules.push(module);
if( json.isShow === false )th.hide(); //隐藏列
if( json.isShow === false ){
th.hide(); //隐藏列
}else if( this.reloading && json.isShow === true){
th.setStyle("display", "");
}
if((json.total === "number") || (json.total === "count"))this.totalFlag = true;
}
}.bind(this));
if(this.editable){
var actionTh = new Element("th", {"styles": {"width": "46px"}}).inject(this.titleTr, "top"); //操作列
var actionTh = new Element("th.mwf_addlineaction", {"styles": {"width": "46px"}}).inject(this.titleTr, "top"); //操作列
if(this.addable){
var addLineAction = new Element("div", {
"styles": this.form.css.addLineAction,
......@@ -291,7 +318,7 @@ MWF.xApplication.process.Xform.DatatablePC = new Class(
}
}).inject(actionTh);
}
var moveTh = new Element("th").inject(this.titleTr, "bottom"); //总计列
var moveTh = new Element("th.mwf_moveaction").inject(this.titleTr, "bottom"); //总计列
if (this.json.border){
Array.each([actionTh,moveTh], function(th){
th.setStyles({
......@@ -334,7 +361,11 @@ MWF.xApplication.process.Xform.DatatablePC = new Class(
// var module = this.form._loadModule(json, td);
// this.form.modules.push(module);
if( json.cellType === "sequence" )td.addClass("mwf_sequence"); //序号列
if( json.isShow === false )td.hide(); //隐藏列
if( json.isShow === false ){
td.hide(); //隐藏列
}else if( this.reloading && json.isShow === true){
td.setStyle("display", "");
}
}
}.bind(this));
......@@ -378,7 +409,11 @@ MWF.xApplication.process.Xform.DatatablePC = new Class(
var json = this.form._getDomjson(th);
if (json){
if( json.isShow === false )td.hide(); //隐藏列
if( json.isShow === false ){
td.hide(); //隐藏列
}else if( this.reloading && json.isShow === true){
td.setStyle("display", "");
}
if ((json.total === "number") || (json.total === "count")){
this.totalColumns.push({
"th" : th,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册