Results 1 to 4 of 4

Thread: Model.replaceFields removes the Id Field

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha Premium User
    Join Date
    Apr 2015

    Default Model.replaceFields removes the Id Field

    Ext version tested:
    • Ext 6.0.0

    Browser versions tested against:

    • Firefox
    • IE

    • Model.replaceFields(fields, true) removes the ID column

    Steps to reproduce the problem:
    • Fiddle below

    The result that was expected:
    • Since the original fields list did not specifically include the IdProperty field (it was defaulted to id by the model definition because I didn't set one), I do not expect it to be removed when replaceFields was called.

    The result that occurs instead:
    • Exception

  2. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Sydney, Australia


    Out of interest, why change the fields of an existing model? Why not just declare a new one?
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  3. #3
    Sencha Premium User
    Join Date
    Apr 2015


    Our model field list is configurable by the end customer, so each server has a unique configuration.

    As part of the sign-in sequence, we define the models.

    As of Ext6, I haven't found a way to redefine the models yet. In touch, I could do a ext.define('model1', {blah...}) and then at re-sign in, do a ext.define('model1', {blah}) if they switched servers etc and touch would just replace the old model with the new one.

    In Ext6, so far, when I try to do this I get an exception saying the model is already defined (I don't recall the exact error, but that's the gist of it). So, I now check is the model is defined, and if so replace the fields...

  4. #4
    Sencha Premium Member Dejan Beciric's Avatar
    Join Date
    Feb 2014
    Belgrade, Serbia


    Also, if you try to remove fields from existing model with removeFields(true), applicatin will throw exception in:idField.allowNull = idField.critical = idField.identifier = true;

    @evant - I have the same problems as FBNitro, with model fields that needs to be dynamically changable

Similar Threads

  1. Replies: 2
    Last Post: 12 Jun 2015, 4:31 PM
  2. [OPEN] Grid Shift Select Scroll, removes selections from selection model
    By rajandvij in forum Sencha GXT Bugs
    Replies: 8
    Last Post: 1 May 2015, 12:20 PM
  3. Replies: 5
    Last Post: 12 Feb 2015, 1:47 AM
  4. Replies: 2
    Last Post: 20 Mar 2013, 2:39 AM
  5. Replies: 2
    Last Post: 6 Sep 2012, 9:59 AM

Posting Permissions

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