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

  • Home
  • SEARCH
  • 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 3226520
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:27:59+00:00 2026-05-17T16:27:59+00:00

I have an ExtJS EditorGridPanel with several columns. One of the columns is bound

  • 0

I have an ExtJS EditorGridPanel with several columns. One of the columns is bound to a complex data type (an array of objects), and uses a custom editor to modify those values in a pop-up window. That part is tested and all works fine – the JsonStore is keeping the complex values, setting the custom editor’s value when it’s focused and editing begins, and picking up the final value when editing is complete.

The only problem is, for this complex data type, the Javascript string value does not appear to include the sub-attributes, but is instead represented as “[object Object]”. Therefore, if the array contains two items when editing begins, and two items after editing is complete, even if some of the sub-attributes of the two items have changed, the grid editor doesn’t know this, because (String)value === (String)startValue (that is, '[object Object],[object Object]' === '[object Object],[object Object]').

I’m certain this is the problem, because if the custom sub-editor increases the number of items in the list, the string values are different ('[object Object],[object Object],[object Object]' !== '[object Object],[object Object]'), and the value properly changes (with change event propagating to the store).

The complete onEditComplete function of the EditorGridPanel is shown below (full source here):

onEditComplete : function(ed, value, startValue){
    this.editing = false;
    this.lastActiveEditor = this.activeEditor;
    this.activeEditor = null;

    var r = ed.record,
        field = this.colModel.getDataIndex(ed.col);
    value = this.postEditValue(value, startValue, r, field);
    if(this.forceValidation === true || String(value) !== String(startValue)){
        var e = {
            grid: this,
            record: r,
            field: field,
            originalValue: startValue,
            value: value,
            row: ed.row,
            column: ed.col,
            cancel:false
        };
        if(this.fireEvent("validateedit", e) !== false && !e.cancel && String(value) !== String(startValue)){
            r.set(field, e.value);
            delete e.cancel;
            this.fireEvent("afteredit", e);
        }
    }
    this.view.focusCell(ed.row, ed.col);
},

So there are a number of possible solutions, but I don’t know how to make any of them work.

  1. Provide a custom GridEditor for this particular column of the EditorGrid, which considers the startValue to always be some dummy value, so that the String(value) !== String(startValue)) clause above is always true. This seems difficult because you don’t have access to the GridEditor from within the custom field (since it is in the Field hierarchy and doesn’t know about the GridEditor controlling it).
  2. Somehow get a handle on the GridEditor being used to control my custom Field, from some kind of event. If I can do that, I can set the startValue (a public property) to some dummy value that is known to be different from the final value. Then the normal “changed value” code will work as expected. I haven’t found any reasonable way to get a handle to this editor from within my field, however.
  3. Convince Javascript to spit out all of the sub-attributes of my objects into the String representation, so that if my object is

var myObj = {
‘objId’: 1,
‘objValue’: value
};

var myValue = [myObj];

then instead of (String)myValue being '[object Object]', it will instead be something like '[{objId:1,objValue:value}]'.

  • 1 1 Answer
  • 3 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-17T16:28:00+00:00Added an answer on May 17, 2026 at 4:28 pm

    Nevermind, it appears that I wasn’t correctly adding the toString() function to my objects. Doing so fixes the problem.

    var myObj = {'objId':1,'objValue':'value'};
    myObj.toString = function(){ return String.format('MyObj {objId:{0},objValue:{1}}',this.objId,this.objValue);};
    
    var myValue = [myObj];
    

    Now, the String value of myValue above is [MyObj {objId:1,objValue:value}] instead of [object Object]and the problem is solved – the GridEditor correctly updates the record when any one of the underlying objects’ attributes have changed.

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

Sidebar

Related Questions

I have an ExtJS Panel that displays several bits of data and needs to
So I have a ExtJs 4 Grid Panel that has two columns. Column ONE
I have an ExtJS ListView control with 4 columns. One of the columns contain
I have an extjs component in its raw object type, for example: var x
I have the following extJs window which has two tabs in it. One of
I am wondering if it is possible in ExtJS to have several values of
I am using EXT-JS 3.2.0 and I have an Ext.grid.EditorGridPanel backed by a Ext.data.Store
I have an ExtJS store with an ajax proxy and json reader: Ext.create('Ext.data.Store', {
I have a Extjs data store in home page and im getting data from
After several failed attempts using ExtJS I have now decided to use javascript.The requirement

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.