1. #1
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,308
    Vote Rating
    125
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default Fire clear event when Store is empty?

    Fire clear event when Store is empty?


    Just a suggestion and maybe this doesn't make sense in all cases. But I think it would be useful to fire the clear event on a data store if you remove all the records.

    Ie I have 3 records in my store and call remove on all 3.

    I think this may clean up code like the following:
    Code:
    ds.on('remove', function() {
    	if (!ds.getCount())
    		tbDeleteFindingBtn.disable();
    });
    Seems to me that the clear event should signify that all records have been removed and not be so tightly bound to the removeAll function.

  2. #2
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    17
    jack.slocum will become famous soon enough jack.slocum will become famous soon enough

      0  

    Default


    The clear event is specifically for when you clear the data store (to avoid numerous delete events). Firing the event delete + clear, would kind of defeat the purpose -> causing 2 grid, view (or other component) renders.

Similar Threads

  1. clear grid totaly
    By emi in forum Ext 1.x: Help & Discussion
    Replies: 10
    Last Post: 25 Apr 2012, 10:28 AM
  2. Clear grid's sort arrow icon
    By SLerman in forum Ext 2.x: Help & Discussion
    Replies: 6
    Last Post: 5 Oct 2011, 5:49 AM
  3. Ext.util.Event.fire()
    By papasi in forum Ext 1.x: Bugs
    Replies: 2
    Last Post: 9 Mar 2007, 11:57 PM
  4. struggle on event fire
    By qiuyl in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 9 Dec 2006, 3:25 PM
  5. fire onclick but not ondrag
    By Slapyo in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 29 Nov 2006, 11:11 PM

Thread Participants: 1