cgi|dhtml|客户端//第四步,实现对栏目及相关论坛的排序,基本思路就是对数组进行重新组合排序。
function On_OrderUp()
{
var CategoryIndex = frmManager.selCategoryName.selectedIndex ;
var ForumIndex = frmManager.selForumName.selectedIndex ;
if (ForumIndex == -1 && CategoryIndex > 0)
{
for (var i = 0 ; i < aCategory.length ; i ++)
{
if (aCategory[i].CategoryID == frmManager.selCategoryName[CategoryIndex].value)
{
var temp = new MakeCategory(aCategory[i].CategoryID , aCategory[i].CategoryName , aCategory[i-1].OrderNum)
aCategory[i].CategoryID = aCategory[i-1].CategoryID
aCategory[i].CategoryName = aCategory[i-1].CategoryName
aCategory[i].OrderNum = aCategory[i].OrderNum
aCategory[i-1] = temp
On_Load()
frmManager.selCategoryName.selectedIndex = i - 1
On_CategoryChange()
return true ;
}
}
}
if (ForumIndex != -1 && ForumIndex > 0)
{
for (var i = 0 ; i < aForum.length ; i ++)
{
if (aForum[i].CategoryID == frmManager.selForumName[ForumIndex].value)
{
var temp = new MakeForum(aForum[i].CategoryID , aForum[i].CategoryName , aForum[i-1].OrderNum , aForum[i].RootCategoryID , aForum[i].Description , aForum[i].MasterID)
aForum[i].CategoryID = aForum[i-1].CategoryID
aForum[i].CategoryName = aForum[i-1].CategoryName
aForum[i].RootCategoryID = aForum[i-1].RootCategoryID
aForum[i].Description = aForum[i-1].Description
aForum[i].MasterID = aForum[i-1].MasterID
aForum[i-1] = temp
&nb
客户端CGI——结合javascript、dhtml实现bbs的backoffice(
80酷酷网 80kuku.com