[CLOSED] Disable a toolbar button when no data in Grid panel

  1. #1

    [CLOSED] Disable a toolbar button when no data in Grid panel

    I would like to disable a button when there is no data in grid panel. What I would like to do is subscribe a event on GridPanel empty text. How can I achieve this?
    Last edited by Daniil; Mar 07, 2014 at 12:40 PM. Reason: [CLOSED]
  2. #2
    Hi @aditya,

    Please listen to a Store's Load event and check the records' length. If it is zero, a GridPanel is going to be empty.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @aditya,

    Please listen to a Store's Load event and check the records' length. If it is zero, a GridPanel is going to be empty.
    Achieved through Load listener of grid panel. Thanks.

    <Listeners>
                        <Load Handler="CheckGridStore(records, #{btnActivateProject});" />
                </Listeners>
    
            function CheckGridStore(records, btnActivateButton)
            {
                alert(records.length);
                if (records.length == 0) {
                    btnActivateButton.setDisabled(true);
                }
                else {
                    btnActivateButton.setDisabled(false);
                }
            }
    Last edited by Daniil; Mar 07, 2014 at 12:40 PM. Reason: Please use [CODE] tags

Similar Threads

  1. [CLOSED] Disable/Enable a Grid via it's Toolbar Button ?
    By sisa in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Apr 18, 2013, 1:42 PM
  2. [CLOSED] Grid Panel not displaying data on button click
    By otouri in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Apr 05, 2013, 6:30 PM
  3. Replies: 4
    Last Post: Apr 27, 2012, 2:07 PM
  4. [CLOSED] How to disable coolite toolbar button
    By Vasudhaika in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 24, 2012, 5:52 AM
  5. Replies: 2
    Last Post: Feb 25, 2011, 1:21 PM

Tags for this Thread

Posting Permissions