2

I have a store on my page:

<ext:Store 
    ID="Store1" 
    runat="server" 
    OnAfterStoreChanged="Store1_AfterChanged" 
    OnRefreshData="MyData_Refresh">
    <Reader>
        <ext:JsonReader>
            <Fields>                                    
                <ext:RecordField Name="Name" />
                <ext:RecordField Name="Id" />             
            </Fields>
        </ext:JsonReader>
    </Reader>
</ext:Store>

I need to run JavaScript code after the Store1_AfterChanged event executes. If it were defined via the DirectEvents section, I could use the After attribute.
How to do it when the event is defined this way (as an attribute of the Store)?

ver
  • 888
  • 1
  • 8
  • 16

3 Answers3

2

I found that I can execute a JS function call from the C# event handler by calling

X.Call("function_name", arguments)

ver
  • 888
  • 1
  • 8
  • 16
1

Try to define script via ResourceManager in Event method:

X.ResourceManager.RegisterClientScriptBlock("After", "Ext.Msg.alert('After');");
Baidaly
  • 1,829
  • 1
  • 15
  • 16
-1

You can register any script with

ScriptManager.RegisterStartupScript

method from your code behind

update: then maybe this link may help: http://www.dotnetcurry.com/ShowArticle.aspx?ID=256

A.B.Cade
  • 16,735
  • 1
  • 37
  • 53
  • I do not need a startup script; I need to call a JS function after one specific event was executed. – ver Dec 12 '11 at 14:15