看不懂这段javascript ,求指导

叶尽缘何 2013-07-11 05:27:56
<script type="text/javascript" >
$(function() {

//$("#northHot").css('height',$(this).height()*0.4);
//$("#centerarea").css('height',$(this).height()*0.4);
$('#dg1').datagrid(
{

onSelect : function(index, row) {
$('#cc1').attr(
'src',
'AllToNewsAction.action?topic_id='
+ row.id);
},
url : 'hotTopicAllAction.action',
queryParams : {
genusId : 0

},
columns : [ [ {
field : 'title',
title : '话题',
width : 200
}, {
field : 'genus',
title : '种类',
align:'center',
width : 50,
formatter : function(val, rec) {
if (val == 1) {
return '<span style="color:red;">政治</span>';
} if (val == 2) {
return '<span style="color:blue;">军事</span>';
}if (val == 3) {
return '<span style="color:Teal;">财经</span>';
}if (val == 4) {
return '<span style="color:#66CCFF;">社会</span>';
}if (val == 5) {
return '<span style="color:black;">两岸</span>';
}else{
return '<span style="color:black;">其他</span>';
}
}

}, {
field : 'newhot',
title : '话题热度',
width : 50,
align:'right',
formatter : function(val, rec) {
return val.toFixed(2);

}
} ] ],
toolbar : [ {
text : '今日热点话题',
iconCls : 'icon-day',
handler : function() {
document.location.href = "topic/dayhotTopicNews.jsp";
}
}, '-', {
text : '上周热点话题',
iconCls : 'icon-week',
handler : function() {
document.location.href = "topic/weekhotTopicNews.jsp";
}
}, '-', {
text : '话题地图模式',
iconCls : 'icon-map',
handler : function() {
var row=$('#dg1').datagrid('getSelected');
document.location.href ='maps/monthLocation.jsp?topic_id='+row.id;
}
}],



pagination : true,

onLoadSuccess : function() {
var rows = $(this).datagrid('getRows');
if (rows.length) {
$(this).datagrid('selectRow', 0);
}
}
});
$(".datagrid-toolbar").append($("#datagridsearch"));

//菜单
$('#ccMenu')
.combobox(
{
formatter : function(row) {
var imageFile = 'images/' + row.icon;
return '<img class="item-img" src="'+imageFile+'"/><span class="item-text">'
+ row.text + '</span>';
},
onSelect : function(record) {
$('#dg1').datagrid('reload', {
genusId : record.id
});

}
});

});
</script>
...全文
158 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
自己找easyui的api来看

87,992

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧