[CLOSED] MVC - Grid CRUD with Form in a Window - Best Practices

  1. #1

    [CLOSED] MVC - Grid CRUD with Form in a Window - Best Practices

    Hi all

    Since I am new to Ext.NET and I see there are many ways for developing a certain functionality I would like to inquire abut the best practice solution when it comes to CRUD operations, grid and the record details presented in a window form.
    Do you post the model to the view (MVC style) and bind it to Store or have a separate service method (store proxy) for this...? Or something else? When it comes to sending the ID's over to the server for presenting the record details window and refreshing the grid after the update, delete or new insert, what would be the most convenient architecture?
    I understand this is a very generic question but I can't afford to waste time on a solution that will give me problems in further development and maintenance in the future and I scrap it eventually. A blog post or a working example(s) would also do. I have downloaded the MVC examples from your website and there I have seen that you use different methods so at the end of the day, what would you choose?

    Thank you
    Last edited by Daniil; Aug 05, 2014 at 12:54 PM. Reason: [CLOSED]
  2. #2
    Hi @registrator,

    Welcome to the Ext.NET forums!

    It is nice that you ask about how to do before doing something.

    Let's go step by step.

    Do you post the model to the view (MVC style) and bind it to Store or have a separate service method (store proxy) for this...?
    Well, it depends. Sending data set to a Store via a Model might be actual for a small data set. If you apply data to the Store's DataSource or Data, it means that all the data will be rendered directly to the page. So, it is OK with a small data set, but it might be a problem with a big data set. The bigger data set => the bigger page => the more time of rendering that page. There are no certain numbers how to treat - a data set is big or small. It mostly depends on amount of rows, columns and how complex that columns (for example, you might use a complex Column's Renderer). Approximately, I would say 100 rows * 10 columns might be good to load at once. Sure, usually we deal with much bigger data sets in the real world. It might be thousands of rows. So, it is not going to work if load everything at once. Also it means what you will probably need remote paging, filtering, sorting. It is quite simple to organize that functionality with a Store's Proxy. So, for big data sets a Store's Proxy is a way to go.

    So, could you estimate how big data set you are going to deal with?
  3. #3
    Hi Daniil

    Thank you for your answer. I think I will go for the "load all at once" approach but I am mostly interested in is what is the best architecture (and possibly how to accomplish) when you want to have a window with a form for edit, update, new and how would you get the ID of the record, present the full data for the record, post it back to controller method and refresh the grid. The form should also have a number of foreign key linked drop downs. Another possible architecture concern.
    I believe you understand what I would like to accomplish.
    If you know of examples within your MVC examples, just point them up for me please.

    Thank you
  4. #4
    when you want to have a window with a form for edit, update, new and how would you get the ID of the record, present the full data for the record
    I think this example is good to start with.
    http://mvc.ext.net/#/GridPanel_Update/Batch/

    post it back to controller method and refresh the grid
    Do you want to post it back from a Window and refresh the entire GridPanel?

    Well, I would recommend to consider an approach to put everything (updated, deleted and new data) to a Store (a GridPanel's one) on client side, then synchronize the Store.
    store.sync();
    Well, exactly as it is done in the example.
  5. #5
    Hi Daniil

    I have looked at the example you pointed out and I don't feel comfortable going that way. That approach requires CRUD manipulation on the client (javascript) side and my skills are stronger on the .NET MVC part so I will look for an approach that is more "MVC like". By this I mean: send over the view model from the controller method to the view, on button click get an ID value of the grid row and post it to the controller method for CUD method, present a view (partial view in Ext.NET case, i guess) form in a window holding the individual record view model populated by the ID, send back the view model back to POST method for update.
    I see that I can keep Data Annotation on the View Model for client text display and form validation.

    Should I keep posting my questions here or should I open new threads for them?

    Thank you
  6. #6
    Should I keep posting my questions here or should I open new threads for them?
    Let's say, post here. If we consider that a new thread is better for a specific question, we will do that.
  7. #7

    Need Response

    Hello, I am also new in mvc ext.net and I want to do the same thing mentioned by the Thread Creator... His question about how to do the example provided (batch) as a "MVC" like and I really need a response

Similar Threads

  1. EXT.NET Crud Operation With Detail Window
    By sskapci in forum 2.x Help
    Replies: 3
    Last Post: May 19, 2014, 7:56 AM
  2. Replies: 4
    Last Post: Oct 25, 2012, 2:02 PM
  3. [CLOSED] Standard Form Window Instead of Event Edit Window
    By ppqrnd in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Dec 07, 2011, 1:20 AM
  4. Window management best practices
    By dbassett74 in forum 1.x Help
    Replies: 1
    Last Post: Apr 20, 2009, 8:24 PM
  5. Best Practices for WebService CRUD operations
    By pkellner in forum Open Discussions
    Replies: 1
    Last Post: Dec 22, 2008, 4:55 PM

Tags for this Thread

Posting Permissions