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 7753053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:57:21+00:00 2026-06-01T11:57:21+00:00

I am new to Extjs4 and the javascript world in general. I have looked

  • 0

I am new to Extjs4 and the javascript world in general. I have looked up the documentation and samples and trying to get a basic CRUD grid up and running with my spring backend.

I have a confusion related to the proxy in extjs, are they in the store or model according to the MVC paradigm ?

I have a controller.js defined which wraps these up together.
I would have thought that the REST calls would be made accroding to the urls being specified, which it is for now , but a create call is still sending the entire list. I am using jackson at the backend for automatic conversion to java objects but somehow that is not working (for add and update only).

How do i link these all up ?

a) Add a user .. do i create a new UserModel and then invoke a rest call like so or is it automatically supported by the proxy specified in the model ?

var record = new App.model.UserModel();
     store = Ext.getStore('UsersStore');
     store.insert(0, record);
     store.save();  // .. this invokes the /createUser method 
                    //   .. what about /update ?

b) I am using the RowEditing plugin .. how can i fetch the roweditor in my controller.js where the reference for the view is available

Thanks in advance

relevant code listings …

//UserController.js

Ext.define('App.controller.UsersController', {
extend : 'Ext.app.Controller',
init: function() {
    this.control({
        'userList button[action=add]' : {
                click : this.editUser
            }         });    },
views : ['user.List','user.Edit'],
stores : ['UsersStore'] ,
models : ['UserModel'],
editUser : function(grid,record)
{
    // empty record
     var record = new App.model.UserModel();
     // created new record

//How to get a reference to the roweditor here and then save that to the backend ?

 //store = Ext.getStore('UsersStore');
     //store.insert(0, record);
     //store.save();
    // this.getView('user.List').getP('rowEditor').startEdit(0, 0);

}});

//List.js

var rowEditor = Ext.create('Ext.grid.plugin.RowEditing', {
clicksToEdit: 2
 }
Ext.define('App.view.user.List' ,{
extend: 'Ext.grid.Panel',
alias : 'widget.userList',
title : 'All Users',
store : 'UsersStore',
selType: 'rowmodel',
plugins: rowEditor,
initComponent: function() {
    this.columns = [
        {header: 'SNo',  dataIndex: 'userID', width:50},
        {header: 'UID',  dataIndex: 'userUID',  flex: 1, editor: 'textfield', allowBlank:false},
        {header: 'Name',  dataIndex: 'userName',  flex: 1, editor:'textfield',allowBlank:false},
        {   header: 'Level',  dataIndex: 'userLevel',  flex: 1,
            editor: {xtype: 'combobox', typeAhead: true, triggerAction: 'all', selectionOnTab:true,
                     store : [
                              ['Level 1','Level 1'],
                              ['Level 2','Level 2'],
                              ['Level 3','Level 3']

                            ]
                }
        },
        {header: 'Email', dataIndex: 'emailID', flex: 1, editor: 'textfield'}
    ];
    this.callParent(arguments);
},
dockedItems : [{
    xtype : 'toolbar',
    items : [{
         text: 'Add',
         iconCls: 'icon-add',
         action: 'add'

    }]
}]});

//Model.js

Ext.define('App.model.UserModel', {
extend: 'Ext.data.Model',
fields: ['userID','userUID','userName', 'userLevel' ,'emailID'],
proxy : {
    type: 'ajax',
    api :
        {
            read : 'rest/user/fetchAll',
            update:'rest/user/updateUser',
            create :'rest/user/createUser',
            destroy : 'rest/user/deleteUser'
        },

    reader :
        {
        type : 'json',
        root : 'users',
        successProperty : 'success'
        },

    writer :
        {
        type : 'json',
        allowSingle : 'true'
        }
}});

//UserStore

Ext.define('App.store.UsersStore', {
extend: 'Ext.data.Store',
model: 'App.model.UserModel',
autoLoad : true});

//Sample Java controller

@Controller
@RequestMapping("/rest/user")
public class UserController {

@RequestMapping(value = "/fetchAll" ,  method= RequestMethod.GET)
public @ResponseBody Map<String,? extends Object> 
    fetchUsers()            {
    Map<String,Object> responseMap = new HashMap<String,Object>();
    responseMap.put("success",true);
    responseMap.put("users",userService.getUserRepository().findAll());
    return responseMap;  }

    // was expecting a single object here ?

@RequestMapping(value = "/createUser")
public @ResponseBody Map<String,? extends Object> 
                         createUser(@RequestBody    List<User> users) 
 {  ...   }

}
  • 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-06-01T11:57:22+00:00Added an answer on June 1, 2026 at 11:57 am
    1. I would put Proxy’s inside store objects, not models. But that just personal preference.

    2. When you add record to the store object, if it has autoSync property set to true it would automatically generate create request. What exactly is happening with your create request? What is being sent?

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

Sidebar

Related Questions

I'm new to ExtJS and only have minimal javascript skills in general. I'm going
New Question I am looking for a way in Javascript to get the parent
I'm new to Javascript and extJS, so please bear with me. I have a
We started a new project and realized that we needed a general purpose javascript
In my extjs column model, here is what i have: new Ext.grid.ColumnModel({ columns: [
I have a pretty standard Grid -> Store -> Model architecture in Extjs4. The
New to javascript, but I'm sure this is easy. Unfortunately, most of the google
new_story GET /story/new(.:format) {:action=>new, :controller=>stories} edit_story GET /story/edit(.:format) {:action=>edit, :controller=>stories} story GET /story(.:format) {:action=>show,
New to FluentNHibernate =D I have a parent/children classes as follows: public class Parent
I wanna use a chart in my new ExtJS4 application. The axes render just

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.