[CLOSED] Submit Grid data with Association - Razor 3.2.1

  1. #1

    [CLOSED] Submit Grid data with Association - Razor 3.2.1

    Hello

    I have 2 grids master/detail using Association in parent store. similar to this example GridPanel - Parent/Child
    I am trying to find best practice for submitting the data for the parent grid and the associated grid. I am using a JS function to call my controller action
    I am getting values for the parent grid but no values for the child grid since you need to select a row first from parent before it is displaying in child grid.

    Also, is there a way to tell if rows is modified, deleted, or added. Thank you for any help you can provide.

    function saveForm(method, actionUrl, creationSuccessRedirectUrlOverride) {
           
            var grids = Ext.ComponentQuery.query('gridpanel'),
                            i = 0;
    
    
            var params = {};
            for (; i < grids.length; i += 1) {
                params['grid'+(i+1)] = Ext.encode(grids[i].getRowsValues());
            }
    
    
            //{
            //    dirtyRowsOnly: true
            //}
            params['grid99'] = Ext.encode(App.gpCoverageLimits.getRowsValues({ selectedOnly: false }));
    
    
            Ext.net.directRequest({
                cleanRequest: true,
                eventMask: {showMask: true},
                formId: 'formPanel',
                method: method,
                url: actionUrl,
                extraParams: params,
                userSuccess: function(response) {
                    onSaveSuccess(response, creationSuccessRedirectUrlOverride);
                }
            });
        }
    Last edited by fabricio.murta; Dec 22, 2015 at 7:52 PM. Reason: Closed
  2. #2
    Hello @idrissb!

    As for checking for modified/added and maybe removed rows, I believe you can use the same logic of the Marking Records sample to keep track of changes.

    And... I don't get your model for the master/child grids. You have a master grid showing some fields, and the child one is but the same grid but with different displayed columns? As you said, seems the child grid is not meant to show just details on the selected entry in the master one?
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Thank you. you can mark as closed.

Similar Threads

  1. MVC Razor + MenuItem + Form data submit
    By bright in forum 2.x Help
    Replies: 2
    Last Post: Nov 04, 2013, 4:09 PM
  2. How to submit grid data on click of a button
    By asharm214 in forum 2.x Help
    Replies: 1
    Last Post: Sep 05, 2013, 5:59 PM
  3. Trouble using a HasMany association
    By shmuly in forum 2.x Help
    Replies: 4
    Last Post: Feb 05, 2013, 9:53 PM
  4. How to Submit FormPanel Data
    By abhijit in forum 1.x Help
    Replies: 3
    Last Post: Feb 24, 2012, 7:18 AM
  5. [CLOSED] Submit gridpanel data in form submit
    By jchau in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jul 14, 2010, 7:25 PM

Posting Permissions