- 注册时间
- 2013-8-27
- 最后登录
- 2014-4-28
- 阅读权限
- 10
- 积分
- 11
- 精华
- 0
- 帖子
- 2
|
本帖最后由 caimaosheng 于 2014-4-25 00:59 编辑
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script src="/Scripts/miniui/boot.js" type="text/javascript"> </script>
<style type="text/css">
html, body {
border: 0;
font-size: 12px;
height: 100%;
margin: 0;
overflow: hidden;
padding: 0;
}
</style>
<script src="/scripts/Guid.js" type="text/javascript"> </script>
<script src="/scripts/business/test.js?V1.52" type="text/javascript"> </script>
</head>
<body>
<input name="btnClient" id="btnClient" class="mini-buttonedit" allowinput="false"
emptytext="选择客户" onbuttonclick="onClientEdit" style="width: 145px;" />
"
</body>
</html>
<script type="text/javascript">
function onClientEdit(e) {
var buttonEdit = e.sender;
var win = mini.createTopSingle(ClientWindow);
win.set({
url: "/code/client/clientDataService.aspx?method=Search",
title: "客户选择",
width: 750,
height: 350
});
win.show();
win.search();
var obj = win._rblDataType;
var item = obj.getSelecteds()
alert(item[0].text)
//初始化数据
win.setData(null, function (action) {
if (action == "ok") {
//获取数据
var row = win.getData();
if (row) {
buttonEdit.setValue(row.clientID);
buttonEdit.setText(row.clientName);
$("#txtClientID").val(row.clientID);
$("#txtClientName").val(row.clientName);
}
$(".client").find(".inputvalue").blur();
}
});
}
</script>
<script type="text/javascript">
/*
标准模板:弹出选择面板
注意,只需要修改搜索框和mini.DataGrid相关的列配置信息即可。
*/
ClientWindow = function () {
ClientWindow.superclass.constructor.call(this);
this.initControls();
this.initEvents();
};
mini.extend(ClientWindow, mini.Window, {
url: "",
keyField: "key",
multiSelect: false,
title: "选择客户",
keyLable: "客户类型",
valueLable: "客户名称",
searchLable: "查询:",
width: 580,
height: 320,
bodyStyle: "padding:0;",
allowResize: true,
showModal: true,
showToolbar: true,
showFooter: true,
initControls: function () {
var toolbarEl = this.getToolbarEl();
var footerEl = this.getFooterEl();
var bodyEl = this.getBodyEl();
//toolbar
var labelId = this.id + "$label";
var topHtml =
//'<div style="padding:5px;text-align:center;">'
'<div style="padding:5px;">'
+ '<div id="rblDataType" name="rblDataType" class="mini-radiobuttonlist" repeatItems="2" repeatLayout="table" repeatDirection="vertical" textField="text" valueField="id" value="cn" required="true" requirederrortext="请选择"> </div>'
+ '</div>';
jQuery(toolbarEl).append(topHtml);
//footer
var footerHtml =
'<div style="padding:8px;text-align:center;">'
+ '<a name="okBtn" class="mini-button" style="width:60px;">确定</a> '
+ '<a name="cancelBtn" class="mini-button" style="width:60px;margin-left:20px;">取消</a> '
+ '</div>';
jQuery(footerEl).append(footerHtml);
/////////////////////////////////////////////////////
//body
this.grid = new mini.DataGrid();
this.grid.set({
multiSelect: this.multiSelect,
style: "width: 100%;height: 100%;",
borderStyle: "border:0",
columns: [
{ type: "checkcolumn", header: "#" },
//{ type: "indexcolumn", header: "#", headerAlign: "center" },
{ header: "所属部门", field: "departmentName" },
{ header: "客户名称", field: "clientName" },
{ header: "客户类型", field: "clientTypename" },
{ header: "联系人", field: "contact" },
{ header: "手机", field: "telephone" }
]
});
this.grid.setUrl(this.url);
this.grid.render(bodyEl);
/////////////////////////////////////////////////////
//组件对象
mini.parse(this.el);
var rblDataType = mini.get("rblDataType");
var rblDataTypeValues = [];
rblDataTypeValues = [
{ "id": "usa", "text": "美国" },
{ "id": "cn", "text": "中国" },
{ "id": "jp", "text": "日本" },
{ "id": "en", "text": "英国" },
{ "id": "de", "text": "德国" },
{ "id": "fr", "text": "法国" },
{ "id": "ca", "text": "加拿大" },
{ "id": "at", "text": "奥地利" },
{ "id": "ch", "text": "瑞士" }
];
rblDataType.load(rblDataTypeValues);
this._rblDataType = mini.getbyName("rblDataType", this);
},
initEvents: function () {
this._rblDataType.on("valuechanged", function () {
var obj = this._rblDataType;
var item = obj.getSelecteds()
alert(item[0].text)
}, this);
/////////////////////////////////////
},
setKeyLable: function (value) {
var labelId = this.id + "$label";
var label = document.getElementById(label);
if (label) {
label.innerHTML = value;
this.keyLable = value;
}
},
setUrl: function (value) {
this.url = value;
this.grid.setUrl(value);
},
setKeyField: function (value) {
this.keyField = value;
},
setMultiSelect: function (value) {
this.multiSelect = value;
this.grid.setMultiSelect(value);
},
search: function (value) {
},
setData: function (data, callback) {
this._Callback = callback;
//this.grid.selects(data);
},
getData: function () {
var row = this.grid.getSelected();
return row;
}
});
mini.regClass(ClientWindow, "ClientWindow");
</script>
点开
buttonedit后
radiobuttonlist是没有选中的
我试了很多方式都不行
本来想上图的,但没找到地方上图 |
|