[CLOSED] Getting a lot of .getSelectionModel().getSelected() is undefined errors..

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] Getting a lot of .getSelectionModel().getSelected() is undefined errors..

    Hi
    In 0.8.2, the code below worked fine...it captures command events from command column buttons in my grid.
     
                            <Command OnEvent="DoCommand" Before="if (command=='Delete') { mask = new Ext.LoadMask(#{GridPanel1}.getEl(), {msg:'Deleting Contact from Group...'});} else { mask = new Ext.LoadMask(#{GridPanel1}.getEl(), {msg:'Loading Contact Details...'});}   mask.show();  "
                                Failure="mask.hide();" Success="mask.hide(); if (command=='Delete') Ext.Msg.alert('Deleted','Contact has been deleted from this group.');">
                                <ExtraParams>
                                    <ext:Parameter Name="command" Value="command" Mode="Raw" />
                                    <ext:Parameter Name="contactId" Value="#{GridPanel1}.getSelectionModel().getSelected().data.ContactId"
                                        Mode="Raw" />
                                    <ext:Parameter Name="companyGroupId" Value="#{GridPanel1}.getSelectionModel().getSelected().data.CompanyGroupId"
                                        Mode="Raw" />
                                </ExtraParams>
                            </Command>
    However, in 1.0, I'm getting an error saying that
    "{GridPanel1}.getSelectionModel().getSelected( )" is undefined.

    If I select the row first, then click the command, it works...as expected.


    How can I change my code so that clicking the command either first selects the row, or how can I obtain the correct row values respective of the row from which my command was launched?


    -Raphael

  2. #2

    RE: [CLOSED] Getting a lot of .getSelectionModel().getSelected() is undefined errors..

    Hi,

    Use 'record' to pass the record associated with the current command
    <ext:Parameter Name="contactId" Value="record.data.ContactId" Mode="Raw" />
    <ext:Parameter Name="companyGroupId" Value="record.data.CompanyGroupId" Mode="Raw" />
  3. #3

    RE: [CLOSED] Getting a lot of .getSelectionModel().getSelected() is undefined errors..

    That worked!
    Thanks

Similar Threads

  1. Replies: 1
    Last Post: Mar 22, 2012, 10:36 AM
  2. Replies: 4
    Last Post: Oct 11, 2011, 2:42 AM
  3. Replies: 1
    Last Post: Jan 03, 2011, 1:49 PM
  4. Replies: 1
    Last Post: Nov 22, 2010, 9:07 AM
  5. Replies: 3
    Last Post: Jul 28, 2010, 10:37 AM

Posting Permissions