Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext JS Premium Member n3rd's Avatar
    Join Date
    Nov 2007
    Location
    Munich
    Posts
    72
    Vote Rating
    0
    n3rd is on a distinguished road

      0  

    Exclamation [FIXED] Ext.DataView.beforeselect not firing

    [FIXED] Ext.DataView.beforeselect not firing


    The documentation specifies the 'beforeselect' event, but it appears that this event is never triggered.

    A quick look at Ext.DataView's source seems to confirm this: the event is indeed never fired.

    Edit: Apparently, this has been mentioned before but no feedback was given.

  2. #2
    Ext JS Premium Member n3rd's Avatar
    Join Date
    Nov 2007
    Location
    Munich
    Posts
    72
    Vote Rating
    0
    n3rd is on a distinguished road

      0  

    Exclamation NOT fixed

    NOT fixed


    Unfortunately, the bug was not resolved in PR4:

    Code:
        onSelectChange: function(record, isSelected, suppressEvent) {
            var me = this,
                view = me.view,
                allowSelect = true,
                select;
            
            if (isSelected) {
                if (!suppressEvent) {
                    select = me.fireEvent('beforeselect', me, record) !== false;
                }
                if (allowSelect) {
                    view.onItemSelect(record);
                    if (!suppressEvent) {
                        me.fireEvent('select', me, record);
                    }
                }
            } else {
                view.onItemDeselect(record);
                if (!suppressEvent) {
                    me.fireEvent('deselect', me, record);
                }
            }
        }
    The "beforeselect" event is indeed now fired, but its return value is completely ignored. I don't want to be a , but it seems to me like that feature was implemented but never actually tested or even used...

  3. #3
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,663
    Vote Rating
    584
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Looks like I accidentally committed without saving:

    Code:
    Ext.selection.DataViewModel.override({
        onSelectChange: function(record, isSelected, suppressEvent) {
            var me = this,
                view = me.view,
                allowSelect = true;
            
            if (isSelected) {
                if (!suppressEvent) {
                    allowSelect = me.fireEvent('beforeselect', me, record) !== false;
                }
                if (allowSelect) {
                    view.onItemSelect(record);
                    if (!suppressEvent) {
                        me.fireEvent('select', me, record);
                    }
                }
            } else {
                view.onItemDeselect(record);
                if (!suppressEvent) {
                    me.fireEvent('deselect', me, record);
                }
            }
        }
    });
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  4. #4
    Ext JS Premium Member n3rd's Avatar
    Join Date
    Nov 2007
    Location
    Munich
    Posts
    72
    Vote Rating
    0
    n3rd is on a distinguished road

      0  

    Default


    Thanks a lot for the quick reply. It's very much appreciated!

Similar Threads

  1. [FIXED] DataView.beforeselect event is never actually fired
    By jep in forum Sencha Touch 1.x: Bugs
    Replies: 7
    Last Post: 20 Sep 2011, 8:09 AM
  2. [FIXED] Android Orientation Change Not Firing
    By gcallaghan in forum Sencha Touch 1.x: Bugs
    Replies: 2
    Last Post: 4 Nov 2010, 8:54 AM
  3. [FIXED-334] Proxy Event 'exception' Never Firing
    By Shane F in forum Sencha Touch 1.x: Bugs
    Replies: 5
    Last Post: 28 Sep 2010, 6:22 PM
  4. [FIXED-189] Store 'datachanged' even firing twice
    By tobinharris in forum Sencha Touch 1.x: Bugs
    Replies: 5
    Last Post: 3 Sep 2010, 11:38 PM
  5. Replies: 1
    Last Post: 31 May 2008, 8:59 AM

Thread Participants: 1