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:
-
-
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:
- Add the ext-2.2.1 folder (that you can download from extjs.com) into YourProject.Web/Scripts/
- Unzip the S#arp Scaffolding package to any temp folder
- Add the two files found within /ExtExtensions (from the S#arp Scaffolding zip) to YourProject.Web/Scripts/Model/Ext.ux/*
- 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>
- Add a folder called ViewScripts under YourProject.Web/Scripts
- Move the S#arp Scaffolding project folder from the unzipped location to YourProject/tools/CrudScaffoldingWithExtJs
- Via VS, add CrudScaffoldingWithExtJs.csproj to your "Code Generation" folder
- Via VS, open CrudScaffoldingWithExtJs/ScaffoldingGeneratorCommand.tt and change the reference to YourProject (and the path at the
bottom) to the appropriate values
- 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