PDA

View Full Version : [CLOSED] Help in gridpanel's cell focus



canusr1
Jul 17, 2013, 5:32 AM
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.

Daniil
Jul 17, 2013, 6:01 AM
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.

canusr1
Jul 17, 2013, 6:30 AM
Thanks for the quick reply.

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


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.

Daniil
Jul 17, 2013, 6:55 AM
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();"

canusr1
Jul 17, 2013, 7:48 AM
Hello Daniil,

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

Is there any other solution? Thank you.


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();"

canusr1
Jul 17, 2013, 10:03 AM
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.


Hello Daniil,

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

Is there any other solution? Thank you.

Daniil
Jul 17, 2013, 4:13 PM
Correct. I understand now why it didn't work with a DirectEvent's Before handler. It is too late to get the data updated.