PDA

View Full Version : [CLOSED] GridPanel, fire edit event for cell after a change (delay 200) not once editor loses focus



rthiney
Nov 01, 2013, 4:58 PM
Hi,
I want to fire my grids cellediting "edit" event after 200 milllisecond delay if value changes..
How can I do that? So, instead of the Edit event firing after the editor loses focus, I want it to fire on change...





<ext:GridPanel runat="server" ID="grid" AutoHeight="true" Border="false" EnableColumnHide="false" EnableColumnMove="false" Width="400px">


<Store>
<ext:Store runat="server" ID="gridStore"></ext:Store>
</Store>
<ColumnModel>
</ColumnModel>
<Plugins>
<ext:CellEditing ID="CellEditing1" runat="server" ClicksToEdit="1">
<Listeners>
<Edit Fn="edit" />
</Listeners>


</ext:CellEditing>
</Plugins>
<View>
<ext:GridView ID="GridView1" runat="server">
<Listeners>
<%-- <Refresh Handler="updateTotal(this.panel, #{Container1});" /> --%>
</Listeners>
</ext:GridView>
</View>
<Listeners>
<AfterRender Handler=" window.parent.App.ContentPlaceHolder1_btnCa.hide() ; " Delay="50" />

</Listeners>
<BottomBar>
<ext:Toolbar runat="server">
<Items>
<ext:ToolbarFill runat="server" />
<ext:Button runat="server" Icon="Disk" Text="OK" ID="btnSave">
<Listeners>
<Click Handler="SaveContents()" />
</Listeners>
</ext:Button>
</Items>
</ext:Toolbar>
</BottomBar>
</ext:GridPanel>

Baidaly
Nov 01, 2013, 8:50 PM
Hello!

Try the following:


<ext:CellEditing runat="server" ClicksToEdit="1">
<Listeners>
<ValidateEdit Handler="return e.value != e.originalValue;" />
<Edit Delay="200" Handler="console.log('Edit');" />
</Listeners>
</ext:CellEditing>

rthiney
Nov 01, 2013, 8:53 PM
Hello!

Try the following:


<ext:CellEditing runat="server" ClicksToEdit="1">
<Listeners>
<ValidateEdit Handler="return e.value != e.originalValue;" />
<Edit Delay="200" Handler="console.log('Edit');" />
</Listeners>
</ext:CellEditing>

This requires the editor to lose focus though...my problem is I want to fire this, during the onchange of the editor...not when it looses focus..

Baidaly
Nov 01, 2013, 9:28 PM
CellEditing plugin cannot do this. You should listen editors' events directly:


<ext:Column
runat="server"
Text="Common Name"
DataIndex="common"
Flex="1">
<Editor>
<ext:TextField runat="server" AllowBlank="false">
<Listeners>
<Change Delay="200" Handler="console.log('Something has been changed');" />
</Listeners>
</ext:TextField>
</Editor>
</ext:Column>

If it doesn't help, please provide your scenario.