EasyUI Forum
September 13, 2025, 07:41:04 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: [1]
1  General Category / EasyUI for jQuery / help for detailview-datagrid on: December 27, 2012, 08:39:09 PM
I want use detailview do more than view data (edit date etc...)
first , load a html and the is
code:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>jQuery EasyUI</title>
        <link rel="stylesheet" type="text/css" href="../js/themes/default/easyui.css">
        <link rel="stylesheet" type="text/css" href="../js/themes/icon.css">
        <script type="text/javascript" src="../js/jquery-1.8.3.js"></script>
        <script type="text/javascript" src="../js/jquery.easyui.all.js"></script>
        <script type="text/javascript" src="datagrid-detailview.js"></script>
        <script>
            $(function(){
                $('#tt').datagrid({
                    title:'DataGrid - DetailView',
                    width:500,
                    height:250,
                    remoteSort:false,
                    singleSelect:true,
                    nowrap:false,
                    fitColumns:true,
                    url:'datagrid_data.json',
                    columns:[[
                            {field:'itemid',title:'Item ID',width:80},
                            {field:'productid',title:'Product ID',width:100,sortable:true},
                            {field:'listprice',title:'List Price',width:80,align:'right',sortable:true},
                            {field:'unitcost',title:'Unit Cost',width:80,align:'right',sortable:true},
                            {field:'attr1',title:'Attribute',width:150,sortable:true},
                            {field:'status',title:'Status',width:60,align:'center'}
                        ]],
                    view: detailview,
                    detailFormatter: function(rowIndex, rowData){
                        return '<table><tr>' +
                            '<td rowspan=6 style="border:0">'+
                            '<div class="aa" id="aa"></div></td>'+
                            '</tr></table>';
                    },
                    onExpandRow:function(){
                        $('.aa').load("menubutton.html");
                        $.getScript("../appjs/menu.js", null);
                    },
                    onClickRow:function(rowIndex, rowData){
                        $('#tt').datagrid('expandRow',rowIndex);
                    }
                });
            });
        </script>
    </head>
    <body>
        <h1>DataGrid - DetailView</h1>

        <table id="tt"></table>
    </body>
</html>

the load html:
Code:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>MenuButton - jQuery EasyUI Demo</title>
</head>
<body>
<h2>MenuButton</h2>
<div class="demo-info">
<div class="demo-tip icon-tip"></div>
<div>
MenuButton include linkbutton and menu.
When create a MenuButton you should assign a menu attribute to the linkbutton.
</div>
</div>

<div style="margin:10px 0;width:100px">
<a href="javascript:void(0)" id="dd1">Disable</a>
<a href="javascript:void(0)" id="dd2">Enable</a>
<a href="javascript:void(0)" id="dd3">3D</a>
<a href="javascript:void(0)" id="dd4">Plain</a>
</div>
<div style="background:#C9EDCC;padding:5px;width:600px;">
<a href="javascript:void(0)" id="mb1" class="easyui-menubutton" data-options="menu:'#mm1',iconCls:'icon-edit'">Edit</a>
<a href="javascript:void(0)" id="mb2" class="easyui-menubutton" data-options="menu:'#mm2',iconCls:'icon-help'">Help</a>
</div>
<div id="mm1" style="width:150px;">
<div data-options="iconCls:'icon-undo'">Undo</div>
<div data-options="iconCls:'icon-redo'">Redo</div>
<div class="menu-sep"></div>
<div>Cut</div>
<div>Copy</div>
<div>Paste</div>
<div class="menu-sep"></div>
<div>
<span>Toolbar</span>
<div style="width:150px;">
<div>Address</div>
<div>Link</div>
<div>Navigation Toolbar</div>
<div>Bookmark Toolbar</div>
<div class="menu-sep"></div>
<div>New Toolbar...</div>
</div>
</div>
<div data-options="iconCls:'icon-remove'">Delete</div>
<div>Select All</div>
</div>
<div id="mm2" style="width:100px;">
<div>Help</div>
<div>Update</div>
<div>About</div>
</div>
</body>
</html>
the load js:
Code:
$(function(){
    $('#dd1').click(function(){
        $('#mb1,#mb2').menubutton({
            disabled:true
        });
    });
    $('#dd2').click(function(){
        $('#mb1,#mb2').menubutton({
            disabled:false
        });
    });
    $('#dd3').click(function(){
        $('#mb1,#mb2').menubutton({
            plain:false
        });
    });
    $('#dd4').click(function(){
        $('#mb1,#mb2').menubutton({
            plain:true
        });
    });
});

the question is ,
Code:
                    onExpandRow:function(){
                        $('.aa').load("menubutton.html");
                        $.getScript("../appjs/menu.js", null);
                    },
if i use the css selector,the html file can display
Code:
                    onExpandRow:function(){
                        $('#aa').load("menubutton.html");
                        $.getScript("../appjs/menu.js", null);
                    },

if i use the id selector ,the html can not display
even I use the css selector , the js file can not parse correctly
anyone can help me with this issue?
2  General Category / EasyUI for jQuery / Re: easyui load on: December 26, 2012, 02:12:03 AM
it works ,thank you
3  General Category / EasyUI for jQuery / Re: easyui load on: December 25, 2012, 07:57:33 PM
use easyui demo to explain the issue
the main page : (panel.html)
Code:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Panel - jQuery EasyUI Demo</title>
        <link rel="stylesheet" type="text/css" href="../js/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../js/themes/icon.css">
<link rel="stylesheet" type="text/css" href="demo.css">
<script type="text/javascript" src="../js/jquery-1.8.3.js"></script>
<script type="text/javascript" src="../js/jquery.easyui.all.js"></script>
<script>
function open1(){
$('#p').panel('open');
}
function close1(){
$('#p').panel('close');
}
function load1(){
$('#p').panel('refresh','layout.html');
}
</script>
</head>
<body>
<h2>Panel</h2>
<div class="demo-info">
<div class="demo-tip icon-tip"></div>
<div>Click the right top buttons to perform actions with panel.</div>
</div>

<div style="margin:10px 0;">
<a href="#" class="easyui-linkbutton" onclick="open1()">Open</a>
<a href="#" class="easyui-linkbutton" onclick="close1()">Close</a>
<a href="#" class="easyui-linkbutton" onclick="load1()">Load</a>
</div>
<div style="height:300px;background:#fafafa;padding:5px;">
<div id="p" class="easyui-panel" style="padding:10px;"
data-options="title:'My Panel',iconCls:'icon-save',
collapsible:true,minimizable:true,maximizable:true,closable:true">
<p>panel</p>
<p>panel</p>
<p>panel</p>
<p>panel</p>
<p>panel</p>
<p>panel</p>
<p>panel</p>
<p>panel</p>
<p>panel</p>
<p>panel</p>
<p>panel</p>
<p>panel</p>
</div>
</div>
</body>
</html>
the load page : use layout.html
Code:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Border Layout - jQuery EasyUI Demo</title>
</head>
<body class="easyui-layout">
<div data-options="region:'north',border:false" style="height:60px;background:#B3DFDA;padding:10px">north region</div>
<div data-options="region:'west',split:true,title:'West'" style="width:150px;padding:10px;">west content</div>
<div data-options="region:'east',split:true,collapsed:true,title:'East'" style="width:100px;padding:10px;">east region</div>
<div data-options="region:'south',border:false" style="height:50px;background:#A9FACD;padding:10px;">south region</div>
<div data-options="region:'center',title:'Main Title'"></div>
</body>
</html>

Use IE8,9,ff17 get the same result
4  General Category / EasyUI for jQuery / easyui load on: December 25, 2012, 06:12:34 PM
for some reason,I can't use iframe in my app,so I want use <div> and  juqery load function.
with easyui , i find a problem :in the loaded html file only datagrid can work well,other work incorrectly(can not parse etc...)
and use the panel refresh function get the same result
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!