久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

使用 ASP.NET、JQuery 和 Suckerfish 構建數據庫驅動的

Building a database driven menu with ASP.NET, JQuery and Suckerfish(使用 ASP.NET、JQuery 和 Suckerfish 構建數據庫驅動的菜單)
本文介紹了使用 ASP.NET、JQuery 和 Suckerfish 構建數據庫驅動的菜單的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在嘗試使用 Suckerfish css 菜單和 Jquery 從表創建菜單.我使用它作為我的參考:Suckerfish menu with ASP.NET 和 JQuery,我讓它使用手動提供的鏈接(很像文章中的那樣).

I'm attempting at creating a menu from a table using the Suckerfish css menu and Jquery. I'm using this as my reference: Suckerfish menu with ASP.NET and JQuery and I have it working with manually supplied links (much like in the article).

我遇到問題的地方是編寫遞歸函數以從數據庫中獲取菜單項并在適當的層次結構中創建新菜單項.我的數據庫表看起來像這樣:

Where I'm having issues is writing the recursive function to get the menu items from the database and create the new menu items in the proper hierarchy. My database table looks like so:

餐桌菜單

菜單ID家長編號關聯文字

MenuID ParentID Link Text

這個想法是,如果一個項目是父級項目,MenuID 和 ParentID 是相同的,如果它是一個子項,它將在 ParentID 字段中具有它的父項的 MenuID.我需要創建一個函數,該函數可以通過并為父母找到所有孩子(可能是幾個級別)并讓它替換如下手動條目:

The idea being that if an item is a parent-level item the MenuID and ParentID are the same, if it's a child it will have the MenuID of it's parent in the ParentID field. I'm needing to create a function that can go through and find all of the children for the parents (could be a few levels) and have it replace manual entries like this:

        Dim Foo As New MenuItem("#", "Foo", Me)
        Items.Add(Foo)
        Foo.Items.Add(New MenuItem("#", "1", Me))
        Foo.Items.Add(New MenuItem("#", "2", Me))
        Foo.Items.Add(New MenuItem("#", "3", Me))
        Foo.Items.Add(New MenuItem("#", "4", Me))

如有必要,我愿意更改數據庫表結構,并且基本上會做任何其他事情來實現這一目標.

I'm open to changing the database table structure if necessary and basically doing anything else to get this going.

感謝您的任何意見,非常感謝.

Thanks for any input, it's much appreciated.

推薦答案

這種表示分層數據的方法對于人類來說很容易理解,但很難從中提取數據,因為它需要遞歸來提取完整??的層次結構.某些 SQL 版本具有可以為您執行此操作的命令,但這就是幕后發生的事情.

That method of representing hierarchical data is easy to understand for humans but difficult to extract data from, because it requires recursion to extract the full hierarchy. Some flavors of SQL have commands that will do this for you, but that is what is going on behind the scenes.

我建議你閱讀更多的樹和;SQL 中的層次結構,并使用它解釋的具體化路徑方法重構您的架構.它很容易查詢并且擴展性非常好.

I suggest you read More Trees & Hierarchies in SQL, and restructure your schema using the materialized path method that it explains. It is easy to query against and scales really well.

這篇關于使用 ASP.NET、JQuery 和 Suckerfish 構建數據庫驅動的菜單的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Set item.selected in ASP.NET Menu Control(在 ASP.NET 菜單控件中設置 item.selected)
How to highlight active page in a masterpage menu?(如何在主頁菜單中突出顯示活動頁面?)
ASP.NET MenuItem Individual Styles(ASP.NET MenuItem 個人樣式)
ASP.NET error on Bitmap.Save quot;Exception (0x80004005): A generic error occurred in GDI+.quot;(Bitmap.Save 上的 ASP.NET 錯誤“異常 (0x80004005):GDI+ 中發生一般錯誤.)
主站蜘蛛池模板: 久久亚洲一区 | 视频二区| 国产成人啪免费观看软件 | 精品久久一区二区 | 亚洲欧美激情四射 | 98久久 | 99热这里只有精品8 激情毛片 | 欧美亚洲高清 | 亚洲美女一区二区三区 | 国产91久久久久蜜臀青青天草二 | 老外几下就让我高潮了 | 午夜久久久 | 做a视频在线观看 | 99精品国产在热久久 | 91精品国产综合久久婷婷香蕉 | 欧美一级黑人aaaaaaa做受 | 亚洲精品久久久一区二区三区 | 日韩午夜 | 成人av大全| 欧美黄 片免费观看 | 综合视频在线 | 成年视频在线观看福利资源 | 天天天操操操 | 日韩在线免费电影 | 中文字幕精品一区二区三区精品 | 免费三级网站 | 欧美一级免费 | 91国产视频在线 | 欧美激情在线观看一区二区三区 | 一级黄色生活视频 | 亚洲精品第一 | 亚洲欧洲成人av每日更新 | 久久国产免费看 | 自拍偷拍第一页 | 亚洲欧美中文日韩在线v日本 | 欧美第一区| 国产亚洲一区二区在线观看 | 亚洲字幕在线观看 | jizz在线看片 | 天堂网色| 嫩草影院网址 |