PDA

View Full Version : [CLOSED] Grid Panel Continuous Cell Editing in v1.x not in v2.x?



garyawalker
Jan 04, 2015, 6:17 PM
Hi

I need to simulate the continuous editing of Grid Panel v1.x in v2.x. meaning when i put in a value in a cell and press enter to accept it, i need to move to the next row in same column. When i Press Tab it moves to the next column.

I saw several post on the issue, but wasn't enough to help or point me in the correct direction.

This snippet seem workable however all my column are created in code behind can you provide me with a sample on how to add the Listeners Specialkey handler in code behind or any order solutions.

Thanks a lot.



NumberField

<ext:NumberField runat="server">
<Listeners>
<SpecialKey Handler="if (e.getKey() === e.ENTER) {
this.up('gridpanel').enterWasPressed = true;
}">
</SpecialKey>
</Listeners>
</ext:NumberField>

CellEditing

<ext:CellEditing runat="server">
<Listeners>
<Edit Handler="if (e.grid.enterWasPressed) {
this.startEdit(e.rowIdx + 1, e.column);
e.grid.enterWasPressed = false;
}" />
</Listeners>
</ext:CellEditing>

Daniil
Jan 05, 2015, 2:32 PM
Hi @garyawalker,


can you provide me with a sample on how to add the Listeners Specialkey handler in code behind

There are two ways, at least.


NumberField nf = new NumberField
{
Listeners =
{
SpecialKey =
{
Handler = @"if (e.getKey() === e.ENTER) {
this.up('gridpanel').enterWasPressed = true;
}"
}
}
};

or


NumberField nf = new NumberField();
nf.Listeners.SpecialKey.Handler = @"if (e.getKey() === e.ENTER) {
this.up('gridpanel').enterWasPressed = true;
}";

tnwheeler
Jan 05, 2015, 2:51 PM
Hi. It sounds like you are doing something similar to what I do:
A real-time, "MS Excel-like", grid with dynamic columns created in code behind.

If this is correct I may have an example that can help you.

garyawalker
Jan 06, 2015, 1:24 AM
Yes that's correct, I would really appreciate the sample!

Daniil
Jan 13, 2015, 5:17 AM
Hi @garyawalker,

Please clarify could we (Ext.NET team) help you more in this thread?

registrator
Jun 10, 2015, 7:56 PM
How can this be done client side? Creating a handler on the column listener?

Thank you

Daniil
Jun 15, 2015, 2:57 PM
Hi @registrator,

Sorry, I don't quite understand the question.

The solution in this thread is based on two client side listeners - CellEditing's Edit and NumberField's SpecialKey. So, it is done on client side.

registrator
Jun 15, 2015, 4:33 PM
Yes, you are right. I'm sorry. I'll give it a try like this.

Thank you