Jan 20, 2014, 5:36 PM
Component Loader using MVC [Razor] error
I'm having difficulty resolving an issue with Component loader in MVC using Razor views. I'm pretty sure the problem is simply the component loader only wants to have Ext.Net components, but it's also likewise that MVC Razor views want the ResourceManager loaded - even into partial views, which the component loader will then try and render and fail.
for example:
Main viewport..
It would be terrific if there were an example on mvc.ext.net of a component-loaded view as a starting point for us to use. I would love to avoid the use of frames, but it seems I'm stuck with them until I can load even the simplest of partial views.
for example:
Main viewport..
X.Viewport ( )
.Layout ( LayoutType.Border )
.Items (
X.Panel ( )
//.Title("North")
.Region ( Region.North )
.Split ( true )
.Height ( 111 )
.Border ( false )
.ItemsFromAction ( "Header_Partial" )
,
X.Panel ( )
.Title ( "West" )
.Region ( Region.West )
.Layout ( LayoutType.Accordion )
.Width ( 300 )
.MinWidth ( 300 )
.MaxWidth ( 300 )
.Split ( true )
.Collapsible ( true )
.Items (
X.Panel ( )
.Title ( "Navigation" )
.Border ( false )
.BodyPadding ( 6 )
.Icon ( Icon.FolderGo )
.Items (
X.Button ( )
.Text ( "tryme" )
.DirectEvents (
de =>
{
de.Click.Before = "console.log(App.SearchBrowserConfig);return(false);";
de.Click.Url = Url.Action ( "test" );
}
)
)
,
X.Panel ( )
.Title ( "Settings" )
.Border ( false )
.BodyPadding ( 6 )
.Icon ( Icon.FolderWrench )
.Html ( "Some settings in here" )
)
,
X.TabPanel ( )
.Region ( Region.Center )
.ID ( "HomePageFilterResults" )
.Listeners (
l =>
{
l.TabChange.Handler = "TabChange(oldTab,newTab)";
}
)
.Items (
panelitems =>
{
foreach ( var browser in Model.HomePageResults )
{
panelitems.Add (
X.Panel ( )
.ID ( "Tab" + browser.DisplayName )
.Title ( browser.DisplayName )
.Loader ( X.ComponentLoader ( )
.Url ( Url.Action ( "TestComponent") )
.Mode ( LoadMode.Component )
.Params ( new
{
browserName = browser.ObjectName
} )
.LoadMask ( lm => lm.ShowMask = true )
)
);
}
}
)
//... more
)
)
}
TestComponent@{
Layout = null;
@Html.X().ResourceManager().CleanResourceUrl(false) //<- LoadMode.Component can't render this, nor can the view work without it
var X = Html.X();
}
@(
X.Button()
.Text("showmeplease")
)
It would be terrific if there were an example on mvc.ext.net of a component-loaded view as a starting point for us to use. I would love to avoid the use of frames, but it seems I'm stuck with them until I can load even the simplest of partial views.