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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:51:28+00:00 2026-05-28T05:51:28+00:00

I have a combo box which displays item quantity. Based on item quantity selection

  • 0

I have a combo box which displays item quantity. Based on item quantity selection i am displaying price value of the item. By default i am setting price value to first item value. However when i load the page, i want my combo box to display first item qty i.e 100.

enter image description here

Problem: it should load Qty : 100 rather loading blank

So i have a store defined as

Store =  new Ext.data.JsonStore({
        storeId: 'Store',
        root: 'storevalue',
        autoLoad: false,
        baseParams: { itemid: '${itemID!""}',
                      adjustPrice: '${adjustPrice}',
                      overrideShowPrice: '${overrideShowPrice}' },
        url: 'ListQtyPrice.epm',
        fields: [ 'qty', 'rawprice', 'displayPrice' ]
    });

Combo box to display Qty

 <#if Select>
         new DBEComboBox({
            name: 'orderqty',
            displayField: 'qty',
            valueField: 'qty',
            id: 'order-qty',
            store: Store,
            forceSelection: true,
            mode: 'remote',
            triggerAction: 'all',
            allowBlank: true, 
            listWidth: 202,
            triggerClass: 'orderqty-trigger', 
            width: 200
            ,defaultValue: 100
            ,listeners: {
                // for price adjustments
            }
         });
        </#if>


Store.load({
            callback: function() {
            alert("reached");
            Ext.getCmp('order-qty').setValue(Store.getAt(0).get('qty'));
            var oqc = Ext.getCmp('order-qty');
            var value = Ext.getCmp('order-qty').getValue();
            alert(" hey :" +value); 
            }
        });

Able to see hey: 100 in alert statements

  • 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-28T05:51:28+00:00Added an answer on May 28, 2026 at 5:51 am

    I’ve run into this problem a couple times. The only way I’ve actually gotten this resolved was to call setValue on the combobox after the store has loaded, you could just add a listener on the store, but that always seemed somewhat messy to me. I usually have a stand-alone event listener like this:

    Store.on('load',function(store) {
        Ext.getCmp('order-qty').setValue(store.getAt('0').get('qty'));
    });
    

    EDIT: 18 Jan 2012

    OK as mentioned here is a complete working example of ComboBox with a default value being set. This is done using ExtJS 4.02, should work fine with 4.07 though, not sure about 4.1.

    Make sure you put your correct extjs path in the links (see brackets at the top of html), otherwise just put both combo-example and data.json at the same directory level and they should run fine:

    data.json:

    [
      {"value":1,"name":"Option 1"},
      {"value":2,"name":"Option 2"},
      {"value":3,"name":"Option 3"}
    ] 
    

    combo-example.html:

    <html>
        <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">    
            <title>Combo Box Example</title>
        <link rel="stylesheet" type="text/css" href="[your extjs path]/resources/css/ext-all.css">
    
        <script type="text/javascript" src="[your extjs path]/ext-all.js"></script>
        <script type="text/javascript" >
    
        Ext.onReady(function() {
    
            // the datastore
            var myStore = new Ext.data.Store({
                fields: ['value', 'name'],
                proxy: {
                    type: 'ajax',
                    url : 'data.json',
                    reader: {
                        type: 'json'
                    }
                },
                autoLoad: true
            });
    
            // a window to hold the combobox inside of a form 
            myWindow = Ext.create('Ext.Window', {
                title: 'A Simple Window',
                width: 300,
                constrain: true,
                modal: true,
                layout: 'fit',
                items: [{
                    // the form to hold the combobox
                    xtype: 'form',
                    border: false,
                    fieldDefaults: {
                        labelWidth: 75
                    },
                    bodyPadding: '15 10 10 10',
                    items: [{
                        // the combobox
                        xtype: 'combo',
                        id: 'myCombo',
                        fieldLabel: 'A Label',
                        valueField: 'value',
                        displayField: 'name',
                        store: myStore,
                        //queryMode: 'local',
                        typeAhead: true,
                        forceSelection: true,
                        allowBlank: false,
                        anchor: '100%'
                    },{
                        // shows the selected value when pressed
                        xtype: 'button',
                        margin: '10 0 0 100',
                        text: 'OK',
                        handler: function() {
                            alert('Name: ' + Ext.getCmp('myCombo').getRawValue() + 
                                  '\nValue: ' + Ext.getCmp('myCombo').value);
                        }
                    }]
                }]
            });
            // show the window
            myWindow.show();
    
            // function to give the combobox a default value
            myStore.on('load',function(store) {
                Ext.getCmp('myCombo').setValue(store.getAt('0').get('value'));
            });
    
        });
    
        </script>
    
        </head>
        <body>
        </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a combo box on a WinForms app in which an item may
I have one combo box which displays a text box when 2nd or 3rd
I have combo box which displays room numbers. Now i want to show room
I have a combo box in which I have to display the dates from
I have a form which has a Combo Box Control. I have selected the
I have a maximized form which has Combo-Box control (docked in top-right) with 500px
I have a page where my combo box has hundreds of elements which makes
I have return cellvaluechanged event for my column1 which contains the category combo box.if
I have a combo box in which I set up an ItemTemplate that looks
I have a combo box in ext js , which is dynamically populated. Nothing

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.