Apr 26, 2011, 1:24 AM
How to handle events
Hi:
I am a newbie to ext.net, however, I have experience with ExtJs and GXT.
What is the best way to handle events that interact with the extjs controls/data on a page? Do I modify the control through JavaScript or through C# code executed via Ajax calls (DirectMethod etc.). I guess that if I need to go the database I need to do it in C#, or perhaps a combination of C# & JavaScript.
Example:
I click on a node in a TreePanel and I need to add a tab to a TabPanel. Do I handle this event entirely in the client JavaScript 100%? Does it make sense to have a DirectMethod call, and add the tab in C#? I checked out the examples project that comes with ext.net and it's done in JavaScript.
Coming from the ExtJs and GXT worlds where the demarcation is clearer, I have trouble picturing in my head how the client state flows from the client side to the server side during DirectMethod calls or posts and how much the server objects reflect the client state.
Another example: Let's say the user adds a new row in a GridPanel on the client side (the row gets added to a Store). If I execute a DirectMethod, is the Ext.net.GridPanel C# object going to contain that new row?
Is there any documentation that you can point me to that describes how this mapping between the client state and server works during ajax and post calls? I guess I am going to spend some time reading the source code as well but it would be nice to see some documentation.
Thanks
I am a newbie to ext.net, however, I have experience with ExtJs and GXT.
What is the best way to handle events that interact with the extjs controls/data on a page? Do I modify the control through JavaScript or through C# code executed via Ajax calls (DirectMethod etc.). I guess that if I need to go the database I need to do it in C#, or perhaps a combination of C# & JavaScript.
Example:
I click on a node in a TreePanel and I need to add a tab to a TabPanel. Do I handle this event entirely in the client JavaScript 100%? Does it make sense to have a DirectMethod call, and add the tab in C#? I checked out the examples project that comes with ext.net and it's done in JavaScript.
Coming from the ExtJs and GXT worlds where the demarcation is clearer, I have trouble picturing in my head how the client state flows from the client side to the server side during DirectMethod calls or posts and how much the server objects reflect the client state.
Another example: Let's say the user adds a new row in a GridPanel on the client side (the row gets added to a Store). If I execute a DirectMethod, is the Ext.net.GridPanel C# object going to contain that new row?
Is there any documentation that you can point me to that describes how this mapping between the client state and server works during ajax and post calls? I guess I am going to spend some time reading the source code as well but it would be nice to see some documentation.
Thanks
Last edited by costab; Apr 26, 2011 at 4:52 AM.