Results 1 to 6 of 6

Thread: "object true has no method bindStore" Error appears when trying to bind a combobox

    Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.
  1. #1
    Sencha User
    Join Date
    Aug 2011
    Posts
    8

    Default "object true has no method bindStore" Error appears when trying to bind a combobox

    Hi There,

    I'm getting the below exception "object true has no method bindStore". This is not appearing always. But most of the time it comes.
    My scenario is:

    Application window has 5 radio buttons.Out of these 2 radio buttons does the same functionality. Binding stores to the combo. One works fine. Other one has issues most of the times.
    The Event handler code is provided below.

    Code:
    function DisplaySettingsField(sender, selectedValue, oldValue, options)
    {
        try
        {
            if(sender.id == "rNoSchedule")
                {
                    //code
                }
                else if(sender.id == "rOnce")
                {
                    //code
                }
                else if(sender.id == "rDaily")
                {
                    //code
                }
                else if(sender.id == "rWeekdays")
                {
                    //code
                    
                }
                else if(sender.id == "rWeekly")
                {
                    try
                    {
                        var DateCombo = Ext.getCmp('comboScheduleSelector');
                        DateCombo .clearValue();
                        DateCombo .bindStore(Store1);
                         //exception in above line
                    }
                    catch(e)
                    {                
                        alert(e.message);
                    }
                }
                else
                {
                    var DateCombo = Ext.getCmp('comboScheduleSelector');
                    DateCombo .clearValue();
                    DateCombo .bindStore(Store2);
                }
        }
        catch(e)
        {
            alert(e.message);
        }
    }
    I have added the radio buttons under a group as follows

    Code:
    //fieldLabel    :    'Schedule',
    id        :    "ScheduleSelector",
    columns    :    1,
    items    :    [
        {
                   boxLabel    :    'No Schedule',
            name        :    'ScheduleSelector',
            id        :    'rNoSchedule',
            checked        :    true,
            inputValue    :    '0',
            listeners    :    {
                change    : function (val, newValue, oldValue, options) {
                    DisplaySettingsField(val, newValue, oldValue, options);
                }
            }
        },
        {
            boxLabel    :    'Once',
            name        :    'ScheduleSelector',
            id        :    'rOnce',
            inputValue    :    '1',
            listeners    :    {
                change    :    function (val, newValue, oldValue, options) {
                    DisplaySettingsField(val, newValue, oldValue, options);
                }
            }
        },
        {
            boxLabel    :    'Daily',
            name        :    'ScheduleSelector',
            id        :    'rDaily',
            inputValue    :    '2',
            listeners    :    {
                change    :    function (val, newValue, oldValue, options) {
                    DisplaySettingsField(val, newValue, oldValue, options);
                }
            }
        },
        {
            boxLabel    :    'Weekdays',
            name        :    'ScheduleSelector',
            id        :    'rWeekdays',
            inputValue    :    '3',
            listeners     :    {
                change    :    function (val, newValue, oldValue, options) {
                    DisplaySettingsField(val, newValue, oldValue, options);
                }
            }
        },
        {
            boxLabel    :    'Weekly',
            name        :    'ScheduleSelector',
            id        :    'rWeekly',
            inputValue    :    '4',
            listeners     :    {
                change    :    function (val, newValue, oldValue, options) {
                    DisplaySettingsField(val, newValue, oldValue, options);
                }
            }
        },
        {
            boxLabel    :    'Monthly',
            name        :    'ScheduleSelector',
            id        :    'rMonthly',
            inputValue    :    '5',
            listeners    :    {
                change    :    function (val, newValue, oldValue, options) {
                    DisplaySettingsField(val, newValue, oldValue, options);
                }
            }
        }
    ]
    The exception is not raising on the outer try catch of the Event Handler. Only in the inner try catch it shows the error
    I'm using Chrome browser to debug the site(Version 16.0.912.75 m)
    Thanks in advance,
    Anulall

  2. #2
    Sencha User hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,966

    Question

    @anullal --

    What is with the spacing^? DateCombo ^ .clearValue();

    If that is not the problem, that would imply the Ext.getCmp () is returning true for some reason! Can you confirm:

    Code:
          else if(sender.id == "rWeekly")             {                
                try                 {    
                     
                         var DateCombo = Ext.getCmp('comboScheduleSelector');
                         DateCombo .clearValue();
                         DateCombo .bindStore(Store1); 
                         //exception in above line                
                } 
                    catch(e) {
                             console.log(DateCombo, e.message);   
                            debugger;              
                     }             
    }
    If you're using Chrome, open the Tools - Developer console (and MOVE AWAY FROM alert(), it's going to make debugging even harder))!
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


  3. #3
    Sencha User
    Join Date
    Aug 2011
    Posts
    8

    Default

    Hi Hendricd,

    Thanks for your time. The spacing was a typo. I had debugged the code using Chrome Developer tool. As you mentioned, the getCmp method returns true most of the time.

  4. #4
    Sencha User hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,966

    Default

    @anulall --

    Can you confirm a few things?

    Ext Version 4.?

    Does the same thing happen in Firefox/Firebug?

    Are you loading other Javascript frameworks/libs along-side Ext?

    Are you aware of any global Object.prototype augmentations applied for toString()?

    Does the DateCombo instance have a custom toString() method?
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


  5. #5
    Sencha User
    Join Date
    Aug 2011
    Posts
    8

    Default

    Hi Hendricd,

    Please see the answer below..

    Ext Version 4.?
    4.0.2a

    Does the same thing happen in Firefox/Firebug?

    Yes. here it shows the error as 'me.loadMask.bindStore is not a function"


    Are you loading other Javascript frameworks/libs along-side Ext?

    I'm not using any other Libraries along with Ext.

    Are you aware of any global Object.prototype augmentations applied for toString()?

    No. There is no core level coding.

    Does the DateCombo instance have a custom toString() method?

    No. The combo store gets dynamically changed upon selection. No custom tostring method

    ~
    Thanks


  6. #6
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,250

    Default

    Would suggest trying with the 4.1 beta, the issue is most likely resolved there.
    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.

Posting Permissions

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