Results 1 to 2 of 2

Thread: Dynamic data for combobox

  1. #1

    Default Dynamic data for combobox

    Hi all,

    In my grid iam displaying the module names and some other info.On clicking the add module button a form is displayed with some fields in that i want to display the combox with module names retrieving the data from database.

    I made a ajax call to retrieve data and assigned the data to a global variable.In the module properties for data iam assigning that value. But it is not displaying.

    As of now i have hardcoded which you see in the attached screenshot as well.
    Attached Images Attached Images

  2. #2

    Default

    Code:
     
    /* Combo box object for types */
    var combo = new Ext.form.ComboBox({
       typeAhead: true,
       triggerAction: 'all',
       lazyRender:true,
    
       store: new Ext.data.JsonStore({
         id: 0,
         root:'types', // Json root element from the server response
        fields: [
         {name:'value', mapping:'value'},
         {name:'meaning', mapping:'meaning'},
        ],
       url:contextPath+'/Expenses?xaction=getCodes'  /* this is your server url which retrieves data for your combo */
    }),
       valueField: 'value',
       displayField: 'meaning'
    });
    have this combo object as the replacement of your combo

Posting Permissions

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