- 注册时间
- 2012-9-26
- 最后登录
- 2014-1-13
- 阅读权限
- 10
- 积分
- 88
- 精华
- 0
- 帖子
- 23
|
本帖最后由 xuefly 于 2012-9-27 11:05 编辑
滚动条突然就出现了,我不清楚改到什么地方的时候问题出现的。不敢修改框架内部的css,但我尝试在我的页面中覆盖框架的css无效果
用以使窗口弹出的代码如下:contentWindowWith=480,contentWindowHeight=220;另外,不是高度没给够的问题。
- function edit() {
- if (currentNode && currentNode.id) {
- mini.open({
- url: bootPATH + "../Organization/CreateOrUpdate",
- title: "编辑组织机构", width: contentWindowWith, height: contentWindowHeight,
- iconCls: "icon-organization",
- onload: function () {
- var iframe = this.getIFrameEl();
- var data = { action: "edit", id: currentNode.id };
- iframe.contentWindow.SetData(data);
- },
- ondestroy: function (action) {
- if (action == "save") {
- var iframe = this.getIFrameEl();
- var data = iframe.contentWindow.GetData();
- data = mini.clone(data); //必须
- var treeObj = $.fn.zTree.getZTreeObj("ztree");
- currentNode.name = data.Name;
- treeObj.updateNode(currentNode);
- var tab = tabs1.getTab(tabs1.activeIndex);
- if (tab.name == "infoTab") {
- tabs1.reloadTab(tab);
- }
- else {
- detailsInitialized = false;
- }
- }
- }
- });
- }
- else {
- mini.alert("请选择一个节点");
- }
- }
复制代码
弹出的页面的前台html代码如下:
- @{
- ViewBag.Title = "Organization CreateOrUpdate";
- Layout = "~/Views/Shared/_Layout.cshtml";
- }
- @section Head{
-
- }
- <form id="form1" method="post">
- <input name="Id" class="mini-hidden" />
- <input name="ParentID" class="mini-hidden" />
- <div style="padding-left: 11px;">
- <table>
- <tr>
- <td style="width: 70px;">
- 编码:
- </td>
- <td style="width: 150px;">
- <input name="Code" class="mini-textbox" required="true" />
- </td>
- <td style="width: 70px;">
- 展示名称:
- </td>
- <td>
- <input name="Name" class="mini-textbox" required="true" />
- </td>
- </tr>
- <tr>
- <td>
- 类别:
- </td>
- <td>
- <input name="CategoryCode" class="mini-combobox" style="width: 125px;"
- textfield="name" valuefield="code" url="@Url.Action("GetDicItemsByCategoryCode", "DicItem", new { code = "organizationCategory" })"
- value="" shownullitem="true" />
- </td>
- <td>
- 简称:
- </td>
- <td>
- <input name="ShortName" class="mini-textbox" />
- </td>
- </tr>
- <tr>
- <td>
- </td>
- <td>
- <input name="IsEnabled" class="mini-checkbox" text="有效" truevalue="1" falsevalue="0" />
- </td>
- <td>
- </td>
- <td>
- </td>
- </tr>
- <tr>
- <td>
- 备注:
- </td>
- <td colspan="3">
- <input name="Description" class="mini-textarea" style="width: 350px;" />
- </td>
- </tr>
- </table>
- </div>
- </form>
- <div style="text-align: center; padding: 10px; width: 95%;">
- <a id="btnOk" class="mini-button" iconcls="icon-save" style="width: 60px; margin-right: 10px;">
- 确定</a> <a id="btnCancel" class="mini-button" iconcls="icon-back" style="width: 60px;">
- 返回</a>
- </div>
- @section Foot{
- <script type="text/javascript" src="@Url.Content("~/Scripts/Views/Organization/CreateOrUpdate.cshtml.js")"></script>
- }
复制代码 弹出的页面的前台js代码如下:
- /// <reference path="../../jquery-1.7.2-vsdoc.js" />
- /// <reference path="../../zTree/js/jquery.ztree.all-3.2.js" />
- /// <reference path="../../miniui/miniui.js" />
- // 接口:SetData、GetData
- (function (window) {
- window.SetData = SetData;
- window.GetData = GetData;
- $().ready(function () {
- $("#btnOk").click(function () {
- SaveData();
- });
- $("#btnCancel").click(function () {
- CloseWindow("cancel");
- });
- });
- mini.parse();
- var form = new mini.Form("form1");
- function SaveData() {
- var data = $("#form1").serialize();
- form.validate();
- if (form.isValid() == false) return;
- $.post("/Organization/CreateOrUpdate", data, function (result) {
- if (result.success) {
- if (!data.Id) {
- $("#form1 input[name='Id']").val(result.id);
- }
- CloseWindow("save");
- }
- else {
- mini.alert(result.msg)
- }
- }, "json");
- }
- function SetData(data) {
- //跨页面传递的数据对象,克隆后才可以安全使用
- data = mini.clone(data);
- if (data.action == "edit") {
- $.ajax({
- url: "/Organization/GetOrganization?id=" + data.id,
- cache: false,
- success: function (result) {
- form.setData(result.data);
- }
- });
- }
- else if (data.action == "new") {
- form.setData(data);
- }
- }
- function GetData() {
- var o = form.getData();
- return o;
- }
- function CloseWindow(action) {
- if (window.CloseOwnerWindow) window.CloseOwnerWindow(action);
- else window.close();
- }
- })(window);
复制代码
|
|