1. #1
    Sencha User
    Join Date
    Nov 2011
    Location
    India
    Posts
    83
    Vote Rating
    0
    Rajat Sharma is on a distinguished road

      0  

    Default itemtap event not firing as expcted.

    itemtap event not firing as expcted.


    Hello all

    I have a Ext.ux.BufferedList, the fourth column of which acts as a hyperlink. The click shall invoke a funtion which displays sort of a floating grid with additional details. Something like:

    Code:
    function displayOverlay(){
       //var overlay = use Ext.getCmp to get overlay Component
      // ParentCmp.showBy(overlay);
    }
    Now it is clear from this function that its only job is to display the "child" list. It does not do anything w.r.t updating the store to be used. That is handled with itemtap event. So we have:
    Code:
    itemtap: function(list, index) {
                       //get related details from Parent list's store using index
                var selectedItemDetails = parentListStore.getAt(index).get('details');
                    // feed the same to a function that updates the child list's store
                updateChildListStore(selectedItemDetails);
            }
    Now, based on above code arrangement, it is clear that itemtap should fire first so that the store gets updated before the click event fires to generate the overlay.
    Upon debugging:
    1st case: expected behavior
    click the 4th column link --> itemtap gets fired --> store gets updated --> click gets fired --> overlay shown with origninal details --> click somewhere else --> overlay disappears --> click link again --> same process

    2nd case: where it fails
    click the 4th column link --> itemtap gets fired --> store gets updated --> click gets fired --> overlay shown with origninal details --> without tapping anywhere else click another row's hyperlink --> old overlay disappears --> itemtap does not get fired --> no store update --> click gets fired --> overlay appears but with old data

    So it looks as if the presence of the old overlay prevents itemptap from getting fired. Which is crucial to store refresh. Everything is normal if i click somewhere else to make the old overlay disappear. May be my debugging conclusion is incorrect. Anyone's help on this is welcome.

  2. #2
    Sencha User
    Join Date
    Nov 2011
    Location
    India
    Posts
    83
    Vote Rating
    0
    Rajat Sharma is on a distinguished road

      0  

    Default


    further to this question, is it possible to manually fire a Sencha event. I was just thinking to fire itemtap manually when it is not getting fired by itself. Is it possible, recommended ?

  3. #3
    Sencha User
    Join Date
    Nov 2011
    Location
    India
    Posts
    83
    Vote Rating
    0
    Rajat Sharma is on a distinguished road

      0  

    Default


    Ok got it. I have to supress the overlay displaying method. It looks as if the second tap (no matter where it is) is utilised in hiding the floating overlay that was there, and hence it does not fire itemtap. So i have to use some flag or something similar on those lines, in order to ensure that either both itemtap and display overlay get called (in that order) or none get called. Just return from the display overla method if it does not satisfy the above rule.