Multiple Grids Thoughts

Last post 03-22-2008 6:24 AM by andyb.uk. 2 replies.

Sort Posts:

  • Multiple Grids Thoughts

    03-21-2008, 1:10 PM
    • Member
      10 point Member
    • MeetNet
    • Member since 03-12-2008, 5:13 PM
    • Posts 13

    I have several MVC pages that render a grid-like control. I now need to create a single page to incorporate all 8 pages. I was thinking that a traditional ASP.NET page and 8 AJAX windows - but is that the most sensible way? Also, I want to send "commands" from the main page to each MVC page.

     

    All ideas appreciated.

     

    Thanks.

    ajax m 

  • Re: Multiple Grids Thoughts

    03-21-2008, 6:18 PM
    • Member
      90 point Member
    • malkir
    • Member since 01-09-2007, 10:05 PM
    • Posts 35

    I created a dynamic javascript grid that just connects to a json source and dynamically creates the table based upon the source using jquery.  I keep meaning to post it somewhere, but I haven't had time to clean it up with work/other projects.  My suggestion is to do something similar.  Most asp.net controls end up just being javascript + serverside anyway, it's just more abstracted.

  • Re: Multiple Grids Thoughts

    03-22-2008, 6:24 AM
    • Member
      96 point Member
    • andyb.uk
    • Member since 02-17-2008, 12:16 PM
    • Posts 18

    I'm taking a phased approach to developing dashboard style pages with multiple grids or widgets:

    1. to quickly develop start off using <%= Html.RenderComponent<GridController>(c => c.List("query 1") %><br/><%= Html.RenderComponent<GridController>(c => c.List("query 2") %> etc., all postbacks/actions would cause a full postback
    2. use jQuery to render partials on the page <div id="grid1"></div><script>$("grid1").load("/Grid/List?q=query%201")</script>
    3. use jQuery to request JSON <div id="grid1"></div><script>$.getJSON("/Grid/List?q=query%201&format=json", function(data) { // iterate and render in #grid1 })</script>

    Then jQuery - or other javascript library - can be used to override the action of any <a> tags to perform an AJAX post using the existing Href attribute and re-update the container #grid1 etc. as required. New command buttons rendered as partials on the page can be coupled up as AJAX ones using something like http://plugins.jquery.com/project/Listen to listen for new buttons based on selectors eg. a.editButton.

Page 1 of 1 (3 items)