Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7091419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:10:59+00:00 2026-05-28T08:10:59+00:00

I need a grid built in extjs designer to add data to the grid

  • 0

I need a grid built in extjs designer to add data to the grid on an event.

so I should have a function that when called with receivedMsg as Args, sends the array data to be added as a new record in the grid.

I do not want it to go out and refresh a json file, not very network friendly.

I have written the server backend myself, and implemented websockets to generate the receivedMsg event.

How can I do this?

Here is where the event should go:

    /*
 * File: app/view/MyGridPanel.js
 * Date: Sat Jan 14 2012 14:58:07 GMT-0500 (Eastern Standard Time)
 *
 * This file was generated by Ext Designer version 1.2.2.
 * http://www.sencha.com/products/designer/
 *
 * This file will be generated the first time you export.
 *
 * You should implement event handling and custom methods in this
 * class.
 */

Ext.define('MyApp.view.MyGridPanel', {
    extend: 'MyApp.view.ui.MyGridPanel',

    initComponent: function() {
        var me = this;
        me.callParent(arguments);
    }
});


[
["Ace Supplies", "Emma Knauer", "555-3529"],
["Best Goods", "Joseph Kahn", "555-8797"],
["First Choice", "Matthew Willbanks", "555-4954"],
["First Choice", "Matthew Willbanks", "555-4954"]
]
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T08:10:59+00:00Added an answer on May 28, 2026 at 8:10 am

    If I understand the question properly, the array that you want to add as a record would first have to be converted into an instance of the same Ext.data.Model that your grid is using. Then you could call your “grid.store.insert()” method. For example, if your grid is using a model called ‘Employee’ like this:

    // Grid data model
    Ext.define('Employee', {
        extend: 'Ext.data.Model',
        fields: [
            {name: 'name',   type: 'int'},
            {name: 'email',  type: 'string'},
            {name: 'start',  type: 'date'},
            {name: 'salary', type: 'int'},
            {name: 'active', type: 'bool'}
        ]
    }); 
    

    You could create the model instance outside of the function with your data and just pass that as the function args, or if you can only get the data as an array (hopefully you can set the sequence), you can create the model instance inside the function itself, shown here:

    // the function you wanted
    addRecord: function(myRecordArray) {
    
        // Create a model instance
        var r = Ext.create('Employee', {
            name: myRecordArray[0],
            email: myRecordArray[1],
            start: myRecordArray[2],
            salary: myRecordArray[3],
            active: myRecordArray[4]
        });
    
        // get the grid store and the number of records in it
        var store = this.getStore();
        var maxIndex = store.getCount();
    
        // adds record to the end of the grid (args are: index, Ext.data.Model[])
        store.insert(maxIndex, r) 
    
    }
    

    You would probably have to tweak this depending on how your store is set-up but that should get it started.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to have a grid on one of my webpages that will be
I have a grid and I need to dynamically replace a control that resides
Consider I have a data grid, I need to find the number of rows
I currently have a table(/grid) of data that I can page, filter and sort.
What I need is a grid with all employees data, and a link to
I have a problem. I need to host grid with controls in ScrollViewer to
I need to implement a grid in asp.net that behaves almost exactly like MS
I need a excel-like grid control in MFC, do anyone have good suggestion to
i have GridView with each Grid as a simple TextView. i need a scrollbar
I have a grid splitter that works good. On the left side of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.