久久久久久久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+ 中發生一般錯誤.)
主站蜘蛛池模板: 国产精品久久在线观看 | 日韩精品免费看 | 国产精品视频久久久久久 | 国产精品成人在线播放 | 在线视频久久 | 日韩在线视频网址 | 久久一区 | 激情免费视频 | 国产精品久久精品 | 国产在线一区二区三区 | 免费一级毛片 | 亚洲日本三级 | 一级片网址| 欧美成人免费 | 一区二区三区欧美 | 中文成人在线 | 2018中文字幕第一页 | 天天草天天 | 日韩一级免费观看 | 久久不卡区 | 中文字幕av在线播放 | 精品视频一区二区三区在线观看 | 中文字幕在线观看 | 国产精品毛片无码 | 国产精品一区二区在线 | 人人玩人人添人人澡欧美 | 国产免费观看一区 | 亚洲视频免费在线观看 | 亚洲欧美日韩精品久久亚洲区 | 日韩成人在线网站 | 亚洲精品影院 | 国产日日操 | av天天干| 91视视频在线观看入口直接观看 | 天天视频一区二区三区 | 视频一区二区三区中文字幕 | 福利国产| 国产成人99久久亚洲综合精品 | 一级毛片视频 | 99亚洲精品 | 欧美精品99 |