[CLOSED] Help in gridpanel's cell focus

  1. #1

    [CLOSED] Help in gridpanel's cell focus

    Hi there,

    After edit the cells and click on the "Save" button, I would like to get this active edited cells in my gridpanel.updated list.

    ChangeRecords<InvoiceLine> _Invoice = new StoreDataHandler(e.ExtraParams["data"]).BatchObjectData<InvoiceLine>();
    
    foreach (InvoiceLine updated in _Invoice.Updated)
                    {                 
                        updateList.Add(updated);
                    }
    But now if I did not focus on any other cells after editing then click on "Save" button, I cannot get the Updated data rows.

    If I click on any other cells or inside the grid panel, that's working fine.

    So, I'm thinking of focusing on any other cells before click on "Save" as follow though I'm not so sure its the solution.

    <ext:Button ID="btnSave" runat="server" Text="Save" Icon="Disk" Visible="true">
                                        <DirectEvents>
                                            <Click OnEvent="SaveClick" Before="#{gvInvoiceList}.stopEditing(true)">
                                                <ExtraParams>
                                                    <ext:Parameter Name="data" Value="#{sInvoiceLine}.getChangedData()" Mode="Raw" Encode="true" />
                                                    <ext:Parameter Name="Values" Value="#{gvInvoiceList}.getRowsValues()" Mode="Raw" Encode="true" />
                                                </ExtraParams>
                                            </Click>
                                        </DirectEvents>
                                    </ext:Button>
    If I do that in button click's event, I'm having "Object does not support this property or method" error.

    I'm a very newbie to Ext.net and I'm not so sure how could able to achieve to focus in other cells before clicking on "Save" button.

    Appreciate your help in advance.

    Thanks.
    Last edited by Daniil; Jul 17, 2013 at 3:13 PM. Reason: Please use [CODE] tags, [CLOSED]
  2. #2
    Hi @canusr1,

    Welcome to the Ext.NET forums!

    Please clarify are you using Ext.NET v1 or v2?

    I am confused by
    #{gvInvoiceList}.stopEditing(true)
    it is a method from v1, but you posted in the Premium Help 2.x forum.

    So, please clarify.
  3. #3
    Thanks for the quick reply.

    I'm using V2 and I'm not sure this stopEditing can help me to get cell focus.

    Quote Originally Posted by Daniil View Post
    Hi @canusr1,

    Welcome to the Ext.NET forums!

    Please clarify are you using Ext.NET v1 or v2?

    I am confused by
    #{gvInvoiceList}.stopEditing(true)
    it is a method from v1, but you posted in the Premium Help 2.x forum.

    So, please clarify.
  4. #4
    I think you are on the right way. I mean that completing of editing should help in your scenario.

    Please try:
    Before="#{gvInvoiceList}.editingPlugin.completeEdit();"
  5. #5
    Hello Daniil,

    I still cannot get data in the updated list. :(

    Is there any other solution? Thank you.

    Quote Originally Posted by Daniil View Post
    I think you are on the right way. I mean that completing of editing should help in your scenario.

    Please try:
    Before="#{gvInvoiceList}.editingPlugin.completeEdit();"
  6. #6
    I've set in <Listeners>

    <Listeners>                                                     
                                            <Click Handler="#{gvInvoiceList}.editingPlugin.completeEdit();" />     
                                        </Listeners>
    instead of <DirectEvents> and yes, it's working fine now. :)

    Thanks so much your help.

    Quote Originally Posted by canusr1 View Post
    Hello Daniil,

    I still cannot get data in the updated list. :(

    Is there any other solution? Thank you.
    Last edited by Daniil; Jul 17, 2013 at 3:11 PM. Reason: Please use [CODE] tags
  7. #7
    Correct. I understand now why it didn't work with a DirectEvent's Before handler. It is too late to get the data updated.

Similar Threads

  1. [CLOSED] focus on first cell in new record gridpanel
    By albayrak in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Jan 09, 2014, 4:40 AM
  2. Replies: 0
    Last Post: Mar 05, 2013, 2:13 PM
  3. GridPanel Cell Focus
    By shaileshsakaria in forum 2.x Help
    Replies: 4
    Last Post: Jan 12, 2013, 6:36 AM
  4. GridPanel cell focus
    By Dominik in forum 1.x Help
    Replies: 12
    Last Post: Mar 02, 2012, 11:21 AM
  5. Replies: 5
    Last Post: Aug 27, 2009, 7:01 AM

Posting Permissions