DirectEvent - OnEvent Not Firing if ExtraParam/GridPanel has no selection?

  1. #1

    DirectEvent - OnEvent Not Firing if ExtraParam/GridPanel has no selection?

    I have the below directevent - two seperate button clicks can call this - however, only on the second button click is the extraparam being used - as otherwise, Gridpanel3 is hidden (when the first possible button to consume this event is clicked) - so problem is thatwhen I click teh first button and Gridpanel3 has no selections - it seems to ignore the onevent fire completely? Is there a way to make the param optional?

    Or is there a way to get a specific field of that gridpanel from the code behind, without using an extraparam (I cannot use the accountNumber field as an identity for the store)

     <DirectEvents>
                                        <Click OnEvent="getBPRIDByCAS02" Before="if (!this.noMask) {Ext.net.Mask.show({msg: 'Updating Selection Based Upon Denial Codes. Please Wait...'}); }"
                                            Complete="Ext.net.Mask.hide();">
                                            <ExtraParams>
                                                <ext:Parameter Name="id" Value="#{GridPanel3}.getRowsValues({selectedOnly:true})[0].AccountNumber"
                                                    Mode="Raw"  />
                                            </ExtraParams>
                                        </Click>
                                    </DirectEvents>
    Last edited by Tbaseflug; Feb 28, 2012 at 1:59 PM.
  2. #2
    Hi,

    If grid has no selection then the following code gives js error because there is no item with 0 index
    #{GridPanel3}.getRowsValues({selectedOnly:true})[0].AccountNumber
  3. #3
    I am trying this now:

     <ext:Parameter Name="id" Value="#{GridPanel3}.getSelectionModel().hasSelection() ?#{GridPanel3}.getRowsValues({selectedOnly:true})[0].AccountNumber : null"
                                                    Mode="Raw" />
    Last edited by Daniil; Feb 28, 2012 at 2:44 PM. Reason: Please use [CODE] tags

Similar Threads

  1. Replies: 3
    Last Post: Jun 27, 2012, 11:55 AM
  2. Pass GridPanel or Store via DirectEvent/ExtraParam
    By slonati_adv in forum 2.x Help
    Replies: 1
    Last Post: Jun 18, 2012, 11:18 PM
  3. Replies: 1
    Last Post: Mar 27, 2012, 2:37 PM
  4. [CLOSED] Send all treepanel nodes to directevent as extraparam
    By KorsG in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Feb 09, 2011, 4:57 PM
  5. Replies: 3
    Last Post: Mar 29, 2010, 9:10 AM

Posting Permissions