[CLOSED] Cannot read property 'getStyle' of null - When setting text of label present inside a collapsed panel

  1. #1

    [CLOSED] Cannot read property 'getStyle' of null - When setting text of label present inside a collapsed panel

    I have an ext label with the ID "LabelText" inside an ext panel.
    I am using Ext.getCmp("panelid").togglecollapse(); to expand or collapse the panel based on another button click.
    I also have an ext grid-panel with checkbox selection model. When a row is selected or de-selected the count of selected rows is updated in the label "LabelText" with App.LabelText.SetText(counter) where counter is based on App.gridPanelRecipients.getSelectionMemory().selec tedIds.

    The problem is when the panel on my page is collapsed and the text of the label is being set it gives the error as
    "Uncaught TypeError: Cannot read property 'getStyle' of null"

    This occurs intermittently.

    Please note that this works fine on Ext.Net 2.5.
    Last edited by fabricio.murta; Apr 27, 2018 at 3:38 PM.
  2. #2
    Hello @iansriley!

    Not quite confident without a test case but I bet this issue is happening due to the hiding mode the panel is using. It may be deallocating components to free up resources and the referenced component is just one of those that's being hid.

    I hope the guess helps you, if not, maybe with a test case we could help you. It really looks like a way ExtJS found to be faster and less resources-hungry in the way from its version 4 series (Ext.NET v2).
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Hello @iansriley!

    It's been a while since we last replied your inquiry here and still no feedback from you. Do you still need help here? We may mark the thread as closed if you do not post a follow-up in 7+ days from now, but we won't lock up the thread, so you'll still be able to post afterwards.
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Cannot read property 'documentElement' of null
    By navalurzu7 in forum 3.x Help
    Replies: 1
    Last Post: Jul 25, 2016, 3:28 PM
  2. Replies: 0
    Last Post: Feb 18, 2016, 9:46 AM
  3. Replies: 1
    Last Post: Dec 15, 2015, 3:18 PM
  4. Replies: 2
    Last Post: Aug 13, 2014, 4:01 AM
  5. [CLOSED]Setting text property of label
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Oct 15, 2008, 1:19 PM

Posting Permissions