Commit 20753cfb authored by 吴贤德's avatar 吴贤德

播控PlayCtrl 命名不规范 —》 Playctrl

parent 8cace41f
<?php
class PlayCtrlAction extends CommonAction{
//管理
public function index(){
$op = I('op');
if($op=="getjson"){
$model = D("PlayCtrl");
$userInfo = $_SESSION["_USER_INFO"];
$inputs = I();
$list = $model->getList("list",$userInfo,$inputs);
$count = $model->getList("count",$userInfo,$inputs);
$total = $count[0]["count"];
echo "{\"total\":\"".$total."\",\"rows\":".json_encode($list)."}";
}else{
$hotelModel = D("Hotel");
$hotel_lists = $hotelModel->where("`status`=0")->select();
$this->hotel_lists = $hotel_lists;
$this->display();
}
}
//添加
public function add(){
$userInfo = $_SESSION["_USER_INFO"];
$id = I('id','',int)?I('id','',int):0;
$model = D("PlayCtrl");
$spModel = D("Sp");
$mediaModel = D("Media");
$hotelModel = D("Hotel");
$spPlaylistModel = D("SpPlaylist");
if($id){
$info =$model->where("id = $id")->find();
$this->info = $info;
}
$hotel_lists = $hotelModel->field("id,`name`,sp_id")->where("`status`=0")->select();
$sp_lists = $spModel->field("id,`name`")->select();
$media_lists = $mediaModel->field("id,title")->select();
$play_lists = $spPlaylistModel->join(" A join sh_sp_playlist_media_map B on A.id = B.playlist_id ")->field("A.id,A.`name`,A.sp_id,group_concat(B.media_id) media_ids")->group("A.id")->select();
$this->hotel_lists = $hotel_lists;
$this->sp_lists = $sp_lists;
$this->media_lists_json = json_encode($media_lists);
$this->hotel_lists_json = json_encode($hotel_lists);
$this->play_lists = $play_lists;
$this->display();
}
//添加处理
public function addHandle(){
//sh_hotel_media_map_1、sh_task_inject、sh_task_inject_log
$model = D("PlayCtrl");
$logModel = D("PlayCtrlLog");
$id = I('id','',int);
$hotel_lists = I("post.hotel_lists");
$media_lists = I("post.media_lists");
if($id){
$data['id'] = $id;
$data["updatetime"]=date('Y-m-d H:i:s');
$r = $model->save($data);
if($r){
echo 'true';
}else{
echo 'false';
}
}else{
$taskData['name'] = I("name");
$taskData['addtime'] = date('Y-m-d H:i:s');
$taskData['remark'] = I("remark");
$task_id = $model->add($taskData);
if($task_id){
foreach($hotel_lists as $key => $value){
list($hotel_id,$sp_id) = explode("-",$value);
$logDataLists = array();
foreach($media_lists as $k => $v){
$logData = array();
$logData['task_id'] = $task_id;
$logData['media_id'] = $v;
$logData['hotel_id'] = $hotel_id;
$logData['sp_id'] = $sp_id;
if($logData){
$logDataLists[] = $logData;
}
}
if($logDataLists){
$log_r = $logModel->addAll($logDataLists);
}
}
}
if($task_id){
echo 'true';
}else{
echo 'false';
}
}
}
//删除处理
public function deleteHandle(){
if(D("PlayCtrl")->where("id=".I("id","",int))->delete()){
echo 'true';
}else{
echo 'false';
}
}
//ajax修改状态
public function updateStatusAjaxHandle(){
$model = D("PlayCtrl");
$data = $_POST;
$data['updatetime'] = date('Y-m-d H:i:s');
if($model->save($data)){
echo 'true';
}else{
echo 'false';
}
}
}
<?php
class PlayCtrlLogAction extends CommonAction{
//管理
public function index(){
$op = I('op');
if($op=="getjson"){
$model = D("PlayCtrlLog");
$userInfo = $_SESSION["_USER_INFO"];
$inputs = I();
$list = $model->getList("list",$userInfo,$inputs);
$count = $model->getList("count",$userInfo,$inputs);
$total = $count[0]["count"];
echo "{\"total\":\"".$total."\",\"rows\":".json_encode($list)."}";
}else{
$hotelModel = D("Hotel");
$spModel = D("Sp");
$hotel_lists = $hotelModel->where("`status`=0")->select();
$sp_lists = $spModel->where("`status`=0")->select();
$this->hotel_lists = $hotel_lists;
$this->sp_lists = $sp_lists;
$this->display();
}
}
//添加
public function add(){
$userInfo = $_SESSION["_USER_INFO"];
$id = I('id','',int)?I('id','',int):0;
$model = D("PlayCtrlLog");
$spModel = D("Sp");
$mediaModel = D("Media");
$hotelModel = D("Hotel");
$spPlaylistModel = D("SpPlaylist");
if($id){
$info =$model->where("id = $id")->find();
$this->info = $info;
}
$hotel_lists = $hotelModel->field("id,`name`,sp_id")->where("`status`=0")->select();
$sp_lists = $spModel->field("id,`name`")->select();
$media_lists = $mediaModel->field("id,title")->select();
$play_lists = $spPlaylistModel->join(" A join sh_sp_playlist_media_map B on A.id = B.playlist_id ")->field("A.id,A.`name`,A.sp_id,group_concat(B.media_id) media_ids")->group("A.id")->select();
$this->hotel_lists = $hotel_lists;
$this->sp_lists = $sp_lists;
$this->media_lists_json = json_encode($media_lists);
$this->hotel_lists_json = json_encode($hotel_lists);
$this->play_lists = $play_lists;
$this->display();
}
//添加处理
public function addHandle(){
//sh_hotel_media_map_1、sh_task_inject、sh_task_inject_log
$model = D("PlayCtrlLog");
$logModel = D("PlayCtrlLog");
$id = I('id','',int);
$hotel_lists = I("post.hotel_lists");
$media_lists = I("post.media_lists");
if($id){
$data['id'] = $id;
$data["updatetime"]=date('Y-m-d H:i:s');
$r = $model->save($data);
if($r){
echo 'true';
}else{
echo 'false';
}
}else{
$taskData['name'] = I("name");
$taskData['addtime'] = date('Y-m-d H:i:s');
$taskData['remark'] = I("remark");
$task_id = $model->add($taskData);
if($task_id){
foreach($hotel_lists as $key => $value){
list($hotel_id,$sp_id) = explode("-",$value);
$logDataLists = array();
foreach($media_lists as $k => $v){
$logData = array();
$logData['task_id'] = $task_id;
$logData['media_id'] = $v;
$logData['hotel_id'] = $hotel_id;
$logData['sp_id'] = $sp_id;
if($logData){
$logDataLists[] = $logData;
}
}
if($logDataLists){
$log_r = $logModel->addAll($logDataLists);
}
}
}
if($task_id){
echo 'true';
}else{
echo 'false';
}
}
}
//删除处理
public function deleteHandle(){
if(D("PlayCtrlLog")->where("id=".I("id","",int))->delete()){
echo 'true';
}else{
echo 'false';
}
}
//ajax修改状态
public function updateStatusAjaxHandle(){
$model = D("PlayCtrlLog");
$data = $_POST;
$data['updatetime'] = date('Y-m-d H:i:s');
if($model->save($data)){
echo 'true';
}else{
echo 'false';
}
}
}
This diff is collapsed.
<!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>播控管理</title>
<link href="__PUBLIC__/css/style_frame.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/js/jquery-easyui-1.3.4/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/js/jquery-easyui-1.3.4/themes/icon.css">
<script type="text/javascript" src="__PUBLIC__/js/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery-easyui-1.3.4/jquery.easyui.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery-easyui-1.3.4/locale/easyui-lang-{$language}.js"></script>
<script type="text/javascript" src="__PUBLIC__/newVsdn/js/zDialog/zDrag.js"></script>
<script type="text/javascript" src="__PUBLIC__/newVsdn/js/zDialog/zDialog.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/common/functions.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/common/md5.js"></script>
<link href="__PUBLIC__/newVsdn/css/style_frame.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!--搜索和按钮 开始 -->
<div class="searchPlayCtrl clearfix">
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">
<div class="hyperchanne clearfix">
<form name="searchform" method="post" action="" id ="searchform">
<input type="hidden" name="op" value="getjson">
<div class="inputBox">
<input class="input" type="text" placeholder="播控名称" name="searchValue">
</div>
<input id="submit_search" name="" type="button" value="查询" class="btn_go_s btn_orange" />
</form>
</div><!--hyperchanne end-->
<div class="">
<ul class="operationBox">
<li class="add">
<a href="javascript:;" onclick="add()" class="on"><span></span>新增</a>
</li>
</ul>
</div><!--mainBox end-->
</div>
</div>
</div>
<!--搜索和按钮 结束-->
<table id="dg" title=""
data-options="
iconCls: 'icon-edit',
singleSelect: true,
url: '/PlayCtrl/PlayCtrl/index/',
method: 'post',
pagination: true,
pageList:[15,30,45,60],
rownumbers: true,
sortName:'id',
sortOrder:'asc',
queryParams: form2Json('searchform'),
fitColumns: true,
height:'auto',
onRowContextMenu : onRowContextMenu
">
<thead>
<tr>
<th data-options="field:'name',width:100" sortable="true">播控名称</th>
<th data-options="field:'addtime',width:30" sortable="true">创建时间</th>
<th data-options="field:'updatetime',width:30" sortable="true">更新时间</th>
<th data-options="field:'status'" sortable="true" align="center">状态</th>
<th field="action" align="center" formatter="InputAction">操作</th>
</tr>
</thead>
</table>
<div id="mm1" class="easyui-menu" style="width:120px;display: none">
<div iconCls="icon-edit" id="menuEdit" onclick="edit()" {:buttonAuth('PlayCtrl','PlayCtrl','add')}>编辑</div>
<div iconCls="icon-cancel" id="menuDel" onclick="del()" {:buttonAuth('PlayCtrl','PlayCtrl','deletehandle')}>删除</div>
<div class="menu-sep"></div>
<div iconCls="icon-edit" id="menuEdit" onclick="edit()" {:buttonAuth('PlayCtrl','PlayCtrl','add')}>列表</div>
<!-- <div class="menu-sep"></div>
<div iconCls="icon-stop" id="menuStop" onclick="enable(1)" {:buttonAuth('PlayCtrl','PlayCtrl','updateStatusAjaxHandle')}>禁用</div>
<div iconCls="icon-start" id="menuStart" onclick="enable(0)" {:buttonAuth('PlayCtrl','PlayCtrl','updateStatusAjaxHandle')}>启用</div>-->
</div>
<div id="mm2" class="easyui-menu" style="width:120px;display: none">
<div iconCls="icon-edit" id="menuEdit" onclick="edit()" {:buttonAuth('PlayCtrl','PlayCtrl','add')}>编辑</div>
<div iconCls="icon-cancel" id="menuDel" onclick="del()" {:buttonAuth('PlayCtrl','PlayCtrl','deletehandle')}>删除</div>
<div class="menu-sep"></div>
<div iconCls="icon-edit" id="menuEdit" onclick="edit()" {:buttonAuth('PlayCtrl','PlayCtrl','add')}>列表</div>
<!-- <div class="menu-sep"></div>
<div iconCls="icon-stop" id="menuStop" onclick="enable(1)" {:buttonAuth('PlayCtrl','PlayCtrl','updateStatusAjaxHandle')}>禁用</div>
<div iconCls="icon-start" id="menuStart" onclick="enable(0)" {:buttonAuth('PlayCtrl','PlayCtrl','updateStatusAjaxHandle')}>启用</div>-->
</div>
<script type="text/javascript">
function onRowContextMenu(e, rowIndex, rowData){
e.preventDefault();
$('#dg').datagrid('unselectAll');
$('#dg').datagrid('selectRow', rowIndex);
$('#mm2').menu('show', {
left:e.pageX,
top:e.pageY
});
}
function InputAction(value, row, index) {
return'<a href="javascript:void(0)" id="mb' + index + '" class="easyui-menubutton" menu="#mm1" iconCls="icon-list" onmouseover="setSelectRow(' + index + ')">'+this.title+'</a>';
}
function TypeAction(value, row, index){
if(value==0){
return '主(Master)';
}else{
return '从(Slave)';
}
}
function setSelectRow(index) {
$('#dg').datagrid('unselectAll');
$('#dg').datagrid('selectRow', index);
}
//初始化菜单按钮
$(function(){
$('#dg').datagrid({
onLoadSuccess: function (data) {
for (i = 0; i < $('#dg').datagrid('getRows').length; i++) {
$('#mb' + i).menubutton();
}
}
})
});
//禁用启用
function enable(status){
var row = $('#dg').datagrid('getSelected');
if (row){
var msg='启用';
if(status==1)
msg='禁用'
$.messager.confirm('操作确认', '确认['+msg+']该记录?', function(r){
if (r){
$.post("/PlayCtrl/PlayCtrl/updateStatusAjaxHandle/", {id:row.id,status:status},
function(data){
$('#dg').datagrid('reload');
});
}
});
}else{
$.messager.alert('提示', '请选择要操作的记录!','info');
}
}
function add(){
pop('80%',700,true,'dg','datagrid','/PlayCtrl/PlayCtrl/add/')
}
function edit(){
var row = $('#dg').datagrid('getSelected');
if (row){
pop('80%',700,true,'dg','datagrid','/PlayCtrl/PlayCtrl/add/id/'+row.id);
}else{
$.messager.alert('提示', '请选择要操作的记录!','info');
}
}
function del(){
var row = $('#dg').datagrid('getSelected');
if (row){
$.messager.confirm('操作确认', '确认[删除]该记录?', function(r){
if (r){
$.post("/PlayCtrl/PlayCtrl/deleteHandle/", {id:row.id},
function(data){
$('#dg').datagrid('reload');
});
}
});
}else{
$.messager.alert('提示', '请选择要操作的记录!','info');
}
}
$("#submit_search").click(function () {
$('#dg').datagrid({ queryParams: form2Json("searchform") }); //点击搜索
});
/**
* JQuery扩展方法,用户对JQuery EasyUI的DataGrid控件进行操作。
*/
$.fn.extend({
/**
* 修改DataGrid对象的默认大小,以适应页面宽度。
*
* @param heightMargin
* 高度对页内边距的距离。
* @param widthMargin
* 宽度对页内边距的距离。
* @param minHeight
* 最小高度。
* @param minWidth
* 最小宽度。
*
*/
resizeDataGrid : function(heightMargin, widthMargin, minHeight, minWidth) {
var height = $(document.body).height() - heightMargin;
var width = $(document.body).width() - widthMargin;
height = height < minHeight ? minHeight : height;
width = width < minWidth ? minWidth : width;
$(this).datagrid('resize', {
//height : height,
width : width
});
}
});
$(function() {
// datagrid数据表格ID
var datagridId = 'dg';
// 第一次加载时自动变化大小
$('#' + datagridId).resizeDataGrid(0, 10, 0, 0);
// 当窗口大小发生变化时,调整DataGrid的大小
$(window).resize(function() {
$('#' + datagridId).resizeDataGrid(0, 10, 0, 0);
});
});
</script>
</body>
</html>
\ No newline at end of file
<!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>播控日志管理</title>
<link href="__PUBLIC__/css/style_frame.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/js/jquery-easyui-1.3.4/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/js/jquery-easyui-1.3.4/themes/icon.css">
<script type="text/javascript" src="__PUBLIC__/js/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery-easyui-1.3.4/jquery.easyui.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery-easyui-1.3.4/locale/easyui-lang-{$language}.js"></script>
<script type="text/javascript" src="__PUBLIC__/newVsdn/js/zDialog/zDrag.js"></script>
<script type="text/javascript" src="__PUBLIC__/newVsdn/js/zDialog/zDialog.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/common/functions.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/common/md5.js"></script>
<link href="__PUBLIC__/newVsdn/css/style_frame.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!--搜索和按钮 开始 -->
<div class="searchPlayCtrl clearfix">
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">
<div class="hyperchanne clearfix">
<form name="searchform" method="post" action="" id ="searchform">
<input type="hidden" name="op" value="getjson">
<div class="inputBox">
<select class="select" name="searchSp">
<option value="0">合作方</option>
<volist name="sp_lists" id="item">
<option value="{$item.id}">{$item.name}</option>
</volist>
</select>
<select class="select" name="searchHotel">
<option value="0">酒店</option>
<volist name="hotel_lists" id="item">
<option value="{$item.id}">{$item.name}</option>
</volist>
</select>
<input class="input" type="text" placeholder="播控名称" name="searchValue">
</div>
<input id="submit_search" name="" type="button" value="查询" class="btn_go_s btn_orange" />
</form>
</div><!--hyperchanne end-->
<div class="">
<ul class="operationBox">
<li class="add">
<a href="javascript:;" onclick="add()" class="on"><span></span>新增</a>
</li>
</ul>
</div><!--mainBox end-->
</div>
</div>
</div>
<!--搜索和按钮 结束-->
<table id="dg" title=""
data-options="
iconCls: 'icon-edit',
singleSelect: true,
url: '/PlayCtrl/PlayCtrlLog/index/',
method: 'post',
pagination: true,
pageList:[15,30,45,60],
rownumbers: true,
sortName:'id',
sortOrder:'asc',
queryParams: form2Json('searchform'),
fitColumns: true,
height:'auto',
onRowContextMenu : onRowContextMenu
">
<thead>
<tr>
<th data-options="field:'task_name',width:100" sortable="true">播控名称</th>
<th data-options="field:'media_name',width:100" sortable="true">媒资名称</th>
<th data-options="field:'hotel_name',width:50" sortable="true">酒店名称</th>
<th data-options="field:'sp_name',width:30" sortable="true">合作方名称</th>
<th data-options="field:'addtime',width:30" sortable="true">创建时间</th>
<th data-options="field:'updatetime',width:30" sortable="true">更新时间</th>
<th data-options="field:'status'" sortable="true" align="center">状态</th>
<!--<th field="action" align="center" formatter="InputAction">操作</th>-->
</tr>
</thead>
</table>
<div id="mm1" class="easyui-menu" style="width:120px;display: none">
<div iconCls="icon-edit" id="menuEdit" onclick="edit()" {:buttonAuth('PlayCtrl','PlayCtrlLog','add')}>编辑</div>
<div iconCls="icon-cancel" id="menuDel" onclick="del()" {:buttonAuth('PlayCtrl','PlayCtrlLog','deletehandle')}>删除</div>
<div class="menu-sep"></div>
<div iconCls="icon-edit" id="menuEdit" onclick="edit()" {:buttonAuth('PlayCtrl','PlayCtrlLog','add')}>列表</div>
<!-- <div class="menu-sep"></div>
<div iconCls="icon-stop" id="menuStop" onclick="enable(1)" {:buttonAuth('PlayCtrl','PlayCtrlLog','updateStatusAjaxHandle')}>禁用</div>
<div iconCls="icon-start" id="menuStart" onclick="enable(0)" {:buttonAuth('PlayCtrl','PlayCtrlLog','updateStatusAjaxHandle')}>启用</div>-->
</div>
<div id="mm2" class="easyui-menu" style="width:120px;display: none">
<div iconCls="icon-edit" id="menuEdit" onclick="edit()" {:buttonAuth('PlayCtrl','PlayCtrlLog','add')}>编辑</div>
<div iconCls="icon-cancel" id="menuDel" onclick="del()" {:buttonAuth('PlayCtrl','PlayCtrlLog','deletehandle')}>删除</div>
<div class="menu-sep"></div>
<div iconCls="icon-edit" id="menuEdit" onclick="edit()" {:buttonAuth('PlayCtrl','PlayCtrlLog','add')}>列表</div>
<!-- <div class="menu-sep"></div>
<div iconCls="icon-stop" id="menuStop" onclick="enable(1)" {:buttonAuth('PlayCtrl','PlayCtrlLog','updateStatusAjaxHandle')}>禁用</div>
<div iconCls="icon-start" id="menuStart" onclick="enable(0)" {:buttonAuth('PlayCtrl','PlayCtrlLog','updateStatusAjaxHandle')}>启用</div>-->
</div>
<script type="text/javascript">
function onRowContextMenu(e, rowIndex, rowData){
e.preventDefault();
$('#dg').datagrid('unselectAll');
$('#dg').datagrid('selectRow', rowIndex);
$('#mm2').menu('show', {
left:e.pageX,
top:e.pageY
});
}
function InputAction(value, row, index) {
return'<a href="javascript:void(0)" id="mb' + index + '" class="easyui-menubutton" menu="#mm1" iconCls="icon-list" onmouseover="setSelectRow(' + index + ')">'+this.title+'</a>';
}
function TypeAction(value, row, index){
if(value==0){
return '主(Master)';
}else{
return '从(Slave)';
}
}
function setSelectRow(index) {
$('#dg').datagrid('unselectAll');
$('#dg').datagrid('selectRow', index);
}
//初始化菜单按钮
$(function(){
$('#dg').datagrid({
onLoadSuccess: function (data) {
for (i = 0; i < $('#dg').datagrid('getRows').length; i++) {
$('#mb' + i).menubutton();
}
}
})
});
//禁用启用
function enable(status){
var row = $('#dg').datagrid('getSelected');
if (row){
var msg='启用';
if(status==1)
msg='禁用'
$.messager.confirm('操作确认', '确认['+msg+']该记录?', function(r){
if (r){
$.post("/PlayCtrl/PlayCtrlLog/updateStatusAjaxHandle/", {id:row.id,status:status},
function(data){
$('#dg').datagrid('reload');
});
}
});
}else{
$.messager.alert('提示', '请选择要操作的记录!','info');
}
}
function add(){
pop('80%',700,true,'dg','datagrid','/PlayCtrl/PlayCtrlLog/add/')
}
function edit(){
var row = $('#dg').datagrid('getSelected');
if (row){
pop('80%',700,true,'dg','datagrid','/PlayCtrl/PlayCtrlLog/add/id/'+row.id);
}else{
$.messager.alert('提示', '请选择要操作的记录!','info');
}
}
function del(){
var row = $('#dg').datagrid('getSelected');
if (row){
$.messager.confirm('操作确认', '确认[删除]该记录?', function(r){
if (r){
$.post("/PlayCtrl/PlayCtrlLog/deleteHandle/", {id:row.id},
function(data){
$('#dg').datagrid('reload');
});
}
});
}else{
$.messager.alert('提示', '请选择要操作的记录!','info');
}
}
$("#submit_search").click(function () {
$('#dg').datagrid({ queryParams: form2Json("searchform") }); //点击搜索
});
/**
* JQuery扩展方法,用户对JQuery EasyUI的DataGrid控件进行操作。
*/
$.fn.extend({
/**
* 修改DataGrid对象的默认大小,以适应页面宽度。
*
* @param heightMargin
* 高度对页内边距的距离。
* @param widthMargin
* 宽度对页内边距的距离。
* @param minHeight
* 最小高度。
* @param minWidth
* 最小宽度。
*
*/
resizeDataGrid : function(heightMargin, widthMargin, minHeight, minWidth) {
var height = $(document.body).height() - heightMargin;
var width = $(document.body).width() - widthMargin;
height = height < minHeight ? minHeight : height;
width = width < minWidth ? minWidth : width;
$(this).datagrid('resize', {
//height : height,
width : width
});
}
});
$(function() {
// datagrid数据表格ID
var datagridId = 'dg';
// 第一次加载时自动变化大小
$('#' + datagridId).resizeDataGrid(0, 10, 0, 0);
// 当窗口大小发生变化时,调整DataGrid的大小
$(window).resize(function() {
$('#' + datagridId).resizeDataGrid(0, 10, 0, 0);
});
});
</script>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment