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

使用 ASP.NET、JQuery 和 Suckerfish 構建數(shù)據(jù)庫驅動的

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

問題描述

我正在嘗試使用 Suckerfish css 菜單和 Jquery 從表創(chuàng)建菜單.我使用它作為我的參考: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).

我遇到問題的地方是編寫遞歸函數(shù)以從數(shù)據(jù)庫中獲取菜單項并在適當?shù)膶哟谓Y構中創(chuàng)建新菜單項.我的數(shù)據(jù)庫表看起來像這樣:

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家長編號關聯(lián)文字

MenuID ParentID Link Text

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

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))

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

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.

推薦答案

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

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 構建數(shù)據(jù)庫驅動的菜單的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

相關文檔推薦

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+ 中發(fā)生一般錯誤.)
主站蜘蛛池模板: 免费看黄色一级片 | 日韩精品视频免费在线观看 | 亚洲精品一区二区三区精华液 | 欧美理论在线观看 | 师生出轨h灌满了1v1 | 欧美三级大片 | www.天天干 | 成人在线视频免费观看 | 亚洲视频精品 | 国产精品永久久久久久久久久 | 91小视频在线观看 | 欧美又粗又长 | 欧美日韩中文在线 | 国产精品久久久久久久成人午夜 | 一级国产片| 国产一级在线观看 | 亚洲欧美乱综合图片区小说区 | 无套内谢的新婚少妇国语播放 | 黄色一级影片 | 日本婷婷 | 999精品在线 | 一区在线播放 | 亚洲精品1 | 激情网站在线观看 | 亚洲免费婷婷 | 懂色av成人一区二区三区 | 成人三级在线观看 | a免费视频| 国产视频一区二区三区四区 | 日本少妇视频 | 国产亚洲视频在线观看 | 国产成人精品免费 | 国产91在线播放 | 日本xxxx69| 一区二区免费看 | 国产激情视频 | 夜夜操av| 久久久久婷婷 | 国产成人在线免费观看 | 国产麻豆一区二区 | 成年人国产 |