
<html>
<head>
<meta charset="UTF-8">
<title>Custom Panel Tools - jQuery EasyUI Demo</title>
<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
<link rel="stylesheet" type="text/css" href="../demo.css">
<script type="text/javascript" src="../../jquery.min.js"></script>
<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
</head>
<body>
<h2>Custom Panel Tools</h2>
<p>Click the right top buttons to perform actions with panel.</p>
<div style="margin:20px 0 10px 0"></div>
<div class="easyui-panel" title="Custom Panel Tools" style="width:700pxheight:200pxpadding:10px"
data-options="iconCls:'icon-save',closable:true,tools:'#tt'">
<p style="font-size:14px">jQuery EasyUI framework helps you build your web pages easily.</p>
<ul>
<li>easyui is a collection of user-interface plugin based on jQuery.</li>
<li>easyui provides essential functionality for building modem, interactive, javascript applications.</li>
<li>using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.</li>
<li>complete framework for HTML5 web page.</li>
<li>easyui save your time and scales while developing your products.</li>
<li>easyui is very easy but powerful.</li>
</ul>
</div>
<div id="tt">
<a href="javascript:void(0)" class="icon-add" onclick="javascript:alert('add')"></a>
<a href="javascript:void(0)" class="icon-edit" onclick="javascript:alert('edit')"></a>
<a href="javascript:void(0)" class="icon-cut" onclick="javascript:alert('cut')"></a>
<a href="javascript:void(0)" class="icon-help" onclick="javascript:alert('help')"></a>
</div>
</body>
</html>
我觉得你可能是想要这个效果吧。
用formatter 举个例子
{ field: 'ed', title: ' *** 作', width: 80, align: 'center',formatter: function (value, rowData, rowIndex) {
return "<input type='button' value='click'>"
}
}
js 中添加 直接在定义datagrid 的时候加上 toolbar 属性toolbar: ["-", {
id: '',
text: '',
iconCls: '',
handler: function () {}
}, "-", {
id: '',
text: '',
iconCls: '',
handler: function () { }
}, "-", {
id: '',
text: '',
iconCls: '',
handler: function () { }
}, "-"]
第二种方法是在页面些个div 在里面可以放入 按钮 输入框 搜索框 之类的 并且给这个div 设置一个 id 然后再定义 datagrid 的地方写 toolbar:"#div的id"
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)