Dobrý den mám dotaz. Tvořím menu ve stylu: http://62.77.84.254:8080/admin/testfilep... Ale potřebuji toto menu načítat z SQL, čehož jsem dosáhl za pomocí: (ale je celé rozbalené)
;WITH CTE AS (
SELECT
*, nadpis, CAST(ISNULL('' ,CONVERT(varchar, nadpis)) + CONVERT(varchar, nadpis) AS VARCHAR(255)) [Path]
FROM New_Menu_left
WHERE id_submenu is NULL
UNION ALL
SELECT
H.*, H.nadpis, CAST(C.[Path] + '/' + CONVERT(varchar, H.nadpis) AS VARCHAR(255))
FROM New_Menu_left H
INNER JOIN CTE C ON C.Id = H.id_submenu
)
SELECT * FROM CTE ORDER BY path
a moje otázka tedy zní jak z tohoto SELECTU mam vypsat pouze kategorie a podkategorii na kterou kliknu. TABULKA:
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[NEW_Menu_Left](
[Id] [int] IDENTITY(5010000,1) NOT NULL,
[Nadpis] [nvarchar](50) NULL,
[id_submenu] [int] NULL,
[Poradi] [nvarchar](50) NULL,
[PoradiSub] [nvarchar](50) NULL,
[Kategorie] [nvarchar](max) NULL,
[PageURL] [nvarchar](50) NULL,
[SQL] [ntext] NULL,
[Role] [nvarchar](50) NULL,
[Css_Text] [nvarchar](50) NULL,
[Css_div] [nvarchar](50) NULL,
[Icon] [nvarchar](50) NULL,
[Icon_Visible] [nvarchar](50) NULL,
[htaccess] [nvarchar](50) NULL,
[Panel] [nvarchar](50) NULL,
[Funkce] [nvarchar](50) NULL,
[text] [ntext] NULL,
CONSTRAINT [PK_NEW_Menu_Left] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
|