Billy McCafferty

Sponsors

The Lounge

Wicked Cool Jobs

Syndication

S#arp Scaffolding with Ext JS

I have uploaded a CRUD scaffolding project for S#arp Architecture projects - let's call it S#arp Scaffolding for some cheesy marketing spice - to  http://www.tinyurl.com/dl7c42...

This S#arp Scaffolding example includes the following capabilities:

  • Includes an Ext JS grid on the index page (compatible with Ext JS 2.2.1 from http://extjs.com/products/extjs/download.php),
  • Creates an associated ViewScripts folder for the model and puts the JavaScript for the index page into it,
  • Includes form HTML which is compliant with Wufoo table-less form styling (http://wufoo.com/)
  • Assumes use of the new SharpModelBinder available on the trunk (and in the VS project template on the trunk),
  • Should easily work with just about any Site.Master file.

To use:

  1. Add the ext-2.2.1 folder (that you can download from extjs.com) into YourProject.Web/Scripts/
  2. Unzip the S#arp Scaffolding package to any temp folder
  3. Add the two files found within /ExtExtensions (from the S#arp Scaffolding zip) to YourProject.Web/Scripts/Model/Ext.ux/*
  4. Add Ext JS references to your Site.Master; e.g.,
    <link type="text/css" href="<%= ResolveUrl("~") %>Scripts/ext-2.2.1/resources/css/ext-all.css" rel="stylesheet" />
    <!-- Optional styling -->
    <link type="text/css" href="<%= ResolveUrl("~") %>Scripts/ext-2.2.1/resources/css/xtheme-gray.css" rel="stylesheet" />
    <% string rootPath = ResolveUrl("~"); %>
    <!-- ExtJS related JavaScript -->
    <script type="text/javascript" src="<%= rootPath %>Scripts/ext-2.2.1/adapter/jquery/ext-jquery-adapter.js"></script>
    <script type="text/javascript" src="<%= rootPath %>Scripts/ext-2.2.1/adapter/ext-base.js"></script>
    <script type="text/javascript" src="<%= rootPath %>Scripts/ext-2.2.1/ext-all-debug.js"></script>
    <!-- Custom ExtJS JavaScript -->
    <script type="text/javascript" src="<%= rootPath %>Scripts/Model/Ext.ux/Ext.ux.grid.Search.js"></script>
    <script type="text/javascript" src="<%= rootPath %>Scripts/Model/Ext.ux/Ext.ux.grid.GroupingSummary.js"></script>
    <script language="javascript" type="text/javascript">
        <!-- Create a generic namespace to be used by custom JavaScript objects and variables -->
        Ext.namespace('SharpJs');
        SharpJs.RootUrl = '<%= rootPath %>';
        Ext.BLANK_IMAGE_URL = SharpJs.RootUrl + 'Scripts/ext-2.2.1/resources/images/default/s.gif';
        <!-- Used by generated index pages - makes it easy to modify grid width globally -->
        Ext.GRID_WIDTH = 1186;
    </script>
  5. Add a folder called ViewScripts under YourProject.Web/Scripts
  6. Move the S#arp Scaffolding project folder from the unzipped location to YourProject/tools/CrudScaffoldingWithExtJs
  7. Via VS, add CrudScaffoldingWithExtJs.csproj to your "Code Generation" folder
  8. Via VS, open CrudScaffoldingWithExtJs/ScaffoldingGeneratorCommand.tt and change the reference to YourProject (and the path at the
    bottom) to the appropriate values
  9. Use as you'd use the default CRUD scaffolding project.

For some recent S#arp Architecture info around the web:

I hope you find this helpful.

Billy McCafferty

 


Posted 04-29-2009 10:10 AM by Billy McCafferty
Filed under:

[Advertisement]

Comments

Marco wrote re: S#arp Scaffolding with Ext JS
on 04-29-2009 5:05 PM

Thanks! is it correct that the wufoo css / stylesheets are missing?

Billy McCafferty wrote re: S#arp Scaffolding with Ext JS
on 04-29-2009 5:17 PM

That's correct...you'll need to add those in yourself under YourProject.Web/Content and refer to them from Site.Master.

DotNetShoutout wrote S#arp Scaffolding with Ext JS - Billy McCafferty - Devlicio.us
on 04-29-2009 7:57 PM

Thank you for submitting this cool story - Trackback from DotNetShoutout

Josh wrote re: S#arp Scaffolding with Ext JS
on 04-30-2009 2:45 PM

Don't forget this Virtual Alt.Net session on S#arp

www.viddler.com/.../25

Ern wrote re: S#arp Scaffolding with Ext JS
on 08-12-2009 6:55 PM

Hi Bill, Got the following error while testing the generator and my configuration, any idea what I'm missing?

Error 1 Running transformation: System.IO.FileNotFoundException: Could not find file 'C:\Projects\SharpTesto\tools\CrudScaffoldingWithExtJs\BrewTests.cs'.

File name: 'C:\Projects\SharpTesto\tools\CrudScaffoldingWithExtJs\BrewTests.cs'

  at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

  at System.IO.File.Move(String sourceFileName, String destFileName)

  at Microsoft.VisualStudio.TextTemplating5F67677E7D7FBB5C109A5728A5FD442F.GeneratedTextTransformation.ScaffoldingGenerator.GenerateDomainObjectAndTests() in c:\Projects\SharpTesto\tools\CrudScaffoldingWithExtJs\Templates\ScaffoldingGenerator.tt:line 127

  at Microsoft.VisualStudio.TextTemplating5F67677E7D7FBB5C109A5728A5FD442F.GeneratedTextTransformation.ScaffoldingGenerator.RunCore() in c:\Projects\SharpTesto\tools\CrudScaffoldingWithExtJs\Templates\ScaffoldingGenerator.tt:line 39

  at T4Toolbox.Generator.Run()

  at Microsoft.VisualStudio.TextTemplating5F67677E7D7FBB5C109A5728A5FD442F.GeneratedTextTransformation.TransformText() in c:\Projects\SharpTesto\tools\CrudScaffoldingWithExtJs\ScaffoldingGeneratorCommand.tt:line 36 C:\Projects\SharpTesto\tools\CrudScaffoldingWithExtJs\ScaffoldingGeneratorCommand.tt 1 1

gpangrango wrote re: S#arp Scaffolding with Ext JS
on 09-08-2009 12:24 AM

yes...i'm got that error too...what i'm missing..???

thanks for sharing...

jainabarah wrote re: S#arp Scaffolding with Ext JS
on 10-21-2009 2:54 PM

decadal high ars business

hugimccut wrote re: S#arp Scaffolding with Ext JS
on 12-09-2009 1:47 PM

others contributed sunlight year cap

Add a Comment

(required)  
(optional)
(required)  
Remember Me?

About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Subscribe
Google Reader or Homepage

del.icio.us CodeBetter.com Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl CodeBetter.com Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of Devlicio.us
Red-Gate Tools For SQL and .NET

NDepend

SlickEdit
 
SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
LiteAccounting.Com
DevExpress
Fixx
NHibernate Profiler
Unfuddle
Balsamiq Mockups
Scrumy
JetBrains - ReSharper
<-- NEW Friend!

 



Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers

 

Community Server (Commercial Edition)

CodeBetter.Com