Results 1 to 4 of 4

Thread: How send several grid records in 1 Ajax Json request.

  1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    23

    Question How send several grid records in 1 Ajax Json request.

    Hello,


    I have created a grid with a checkbox column, as in the example
    (Grid Plugins - grid 4) - the CheckboxModel has selectionchange
    listener.
    How do send all of the selected records to the server in 1 ajax,
    json request? Is there an example?
    With one record I could do record.save()...


    I shall create a json writer and an ajax proxy on the model/store.


    Thank you,
    bryan

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,449
    Answers
    3997

    Default

    If you can get a list of the records you want I would iterate over them and build an array of objects and then send in an ajax call
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

  3. #3

    Default How To Send Array Of Objects from Extjs editor grid

    Quote Originally Posted by mitchellsimoens View Post
    If you can get a list of the records you want I would iterate over them and build an array of objects and then send in an ajax call
    I want to send the multiple records to the server in Array of Objects Form

  4. #4
    Sencha Premium Member
    Join Date
    Oct 2013
    Posts
    24

    Default

    Hi, maybe it can help you, I do like this to send several records.

    Code:
                    var items   = [];
    
    
                       var item = {
                            // Data
                            id          : id_in_viewed, 
                            relevance   : relevance,
                            com         : com,
                        };
                        items.push(item);
    
    
                        Ext.Ajax.request({
                            scope       : this,
                            url         : 'data/add.php',
                            method      : 'POST',
                            jsonData    : Ext.JSON.encode(items),
                            params: {
                                frombibsheet: true
                            },
                            success : function(response){
    
    
                            },
                            failure : function(response){
    
    
                            }
                        });

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •