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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:52:00+00:00 2026-05-24T23:52:00+00:00

The problem is: How can I set a default value of a xtype:’numberfield’ ?

  • 0

The problem is: How can I set a default value of a xtype:’numberfield’ ?
I found out at the documentation of Ext.Js 4 that you should set the value field.

http://docs.sencha.com/ext-js/4-0/#!/api/Ext.form.field.Number

value : Object.

A value to initialize this field with.

The only problem is, when I define the value:23 for example, nothing happens.
Maybe I am doing something on the code that is overriding its behaviour. The code you can find bellow:

/// <reference path="ext-4.0/ext-all.js" />
Ext.define('IssueInventoryPartGrid.view.inventorypart.Issue', {
    extend: 'Ext.grid.Panel'
    , alias: 'widget.issueinventorypartlist'
    , store: 'IssueInventoryParts'
    , title: 'Issue Inventory Part'
    , selModel: 'cellmodel'
    , plugins: [
        Ext.create('Ext.grid.plugin.CellEditing', {
            clicksToEdit: 1
        })
    ]
    , width: 523
    , height: 600
    , loadMask: true

    , initComponent: function () {
        this.columns = [
            {
                header: 'Id'
                , dataIndex: 'Id'
                , hideable: false
                , hidden: true
                , flex: 1
            }
            , {
                header: 'Quantity to Issue'
                , dataIndex: 'QtyToIssue'
                , hideable: false
                , flex: 1
                , editor:
                {
                    xtype: 'numberfield'
                    , hideTrigger: true
                    , value: 99
                    , minValue: 0
                    , disabled: false
                    , allowBlank: true
                    , decimalPrecision: 4

                }
            }
            , {
                header: 'Available'
                , dataIndex: 'AvailableQty'
                , flex: 1
            }
            , {
                header: 'Batch Number'
                , dataIndex: 'BatchNumber'
                , flex: 1
            }
            , {
                header: 'Stock Address'
                , dataIndex: 'StockAddressName'
                , flex: 1
            }
            , {
                header: 'Quantity On Hand'
                , dataIndex: 'QtyOnHand'
                , flex: 1
            }
            , {
                header: 'Reserved Quantity'
                , dataIndex: 'ReservedQty'
                , flex: 1
            }
            , {
                header: 'Total Cost'
                , dataIndex: 'TotalCost'
                , flex: 1
            }
            , {
                header: 'Date Received'
                , dataIndex: 'DateReceived'
                , flex: 1
                , renderer: Ext.util.Format.dateRenderer('d/m/Y')
            }
        ];

        this.callParent(arguments);
    }
});

best regards,

Tito Morais

  • 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-24T23:52:00+00:00Added an answer on May 24, 2026 at 11:52 pm

    there is nothing wrong with what you are doing but what i know is that you are loading the grid with data from the store, this means that the grid will always take up the value from the store and the value set via the plugin won’t surface in the field.

    what i would suggest, if what you intend to do is set a default value for the QtyToIssue dataindex, then you could use the model definition to set a default value and make sure that the data from the store doesn’t contain the QtyToIssue field.
    The model could look like this:

    Ext.define("IssueInventoryPartGrid.model.Issue", {
        extend: "Ext.data.Model",
        fields: [
            {
                name: "id", 
                type: "string"
            },
            {
                name: "QtyToIssue",
                type: "float",  // or "int" depending on your data
                defaultValue: 99  // default value to set
            }
        ]
    });
    

    by doing this, the model will assign a default value for each store record that won’t be having a QtyToIssue field.
    try it out or you may advise accordingly. GBU

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

Sidebar

Related Questions

Here's the problem I'm having, I've got a set of logs that can grow
I'm having a strange problem where I can't seem to set the initial value
I think that this problem can be sorted using reflection (a technology which I'm
My problem is I have an existing table that I can not modify that
I have a non-nullable database column which has a default value set. When inserting
EDIT: It turns out that the problem was with an input parm. Apparently, if
I've got a little problem that's slightly frustrating. Is it possible to set a
I've had problem when trying write a function which has a default value when
How can one accomplish class-based default value in following scheme? I mean, I would
Problem: How can I tell if a selection of text in the CRichEditCtrl has

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.