Results 1 to 2 of 2

Thread: I need to place TreeStore data into Combobox

  1. #1

    Default I need to place TreeStore data into Combobox

    Question. Please bare me because I am still new with extjs

    I am trying to modify the output of an existing (GroupingTree) Tree store to something useful for the simple Combo box drop down because
    the server side code is not returning data in the format that I need.
    I created a UI Combobox in the code exmple shown below (my function code is commented out)
    My store (a Tree store) is coming from a file named GroupingTree.js

    but for some reason my function getCustomStore is not getting called so customStore is not being returned

    My Function code

    Ext.define('', {
    extend: 'Ext.form.field.ComboBox',
    alias: 'widget.customcaptionNew',
    id: 'txtCustomCaption', //TODO: Remove ID - Check with QA
    isFormattingControl: true,
    * Initialization of CustomCaption
    * @method initComponent
    initComponent: function () {
    var config = {
    fieldLabel: 'Custom Caption as Dropdown',
    blankText: TV.Global.ErrorMessages.CustomCaptionError,
    name: 'Caption',
    anchor: '100%',
    allowBlank: false,
    validateOnChange: true,
    vtype: 'name',
    minChars: 2,
    typeAhead: 'true',
    valueField: 'aggregationCode',
    name: 'aggregationName',
    /*store: new{fields:['aggregationCode','aggregationName'],
    data: [['agg1','Cusip'],
    store: getCustomStore()


    Ext.apply(this, Ext.apply(this.initialConfig, config));
    // Custom validator. For validating the entered caption for analytic.
    Ext.apply(Ext.form.field.VTypes, {
    name: nameValidator,
    nameText: TV.Global.ErrorMessages.blankText
    var getCustomStore = function(){
    /*var customCaptionStore = {};
    var fields = ["aggregationName", "aggregationCode"];
    var data = [{"name","Id"}];
    //var tempStore = this.getStore(Store.GroupingTreeStore);
    //alert("Got the proper store");
    var fields = ['abbr', 'name'];
    var data = [];
    for (var x = 0; x < tempStore.getRootNode().childNodes[1].childNodes.length; x++){
    data.push({name : tempStore.getRootNode().childNodes[1].childNodes[x].raw.text, abbr: tempStore.getRootNode().childNodes

    var states = Ext.create('', {
    customCaptionStore = Ext.create('', {
    return customCaptionStore;*/
    alert("Called debug");
    return new{fields:['aggregationCode','aggregationName'],
    data: [['agg1','Cusip'],

    Grouping tree.js store code
    Ext.define('', {
    extend: '',
    filtered: false,
    model: 'TV.model.AggregationTag',
    proxy: {
    type: 'direct',
    directFn: ContainerConfigurationData.GetAggregations,
    paramOrder: ['clientId', 'nodeToLoad', 'searchKey'],
    paramsAsHash: true
    autoLoad: false,
    treeField: TV.constants.Constant.DataTabFields.GroupingsTreeColumnName,
    //groupField: 'Category',
    root: {
    expanded: true,
    loaded: true // Because groupfield is not defined, this is actually required for loading

    Please help. This is killing me

  2. #2
    Sencha Premium User
    Join Date
    Mar 2011

Tags for this Thread

Posting Permissions

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