Dec 07, 2010, 6:10 PM
[CLOSED] Rendering Ext.Net control (generated during Ajax event) to an ExtJs client side object?
Hi,
I have an ExtJs tab panel created in JavaScript using ExtJs (not Ext.Net. I am not in a position to change this at the moment, unfortunately).
What I'd like to do is when a tab is activated for the first time,
I've seen examples such as these:
These are close to what I want, except those examples load their content into a Panel or Window generated using Ext.Net so all the wireup code is already there, whereas my TabPanel is generated directly using ExtJs.
The reason I'd like to get the server to send me a grid panel is that we already have custom code to generate our grids using Ext.Net, so I'd like to reuse that (as we work out the columns and their types on the fly based on some other info) so it is not easy to generate this using ExtJs directly on the client side, which is what I'd otherwise do.
Are there any pointers or examples that I may have missed?
E.g. I am guessing the ajax call could be made to a custom ashx handler which will return the right JavaScript that I then manually invoke/execute and add the resulting grid to the tab. If that is right, I guess in a ProcessRequest of an ashx if I just did a new Ext.Net.GridPanel() could I just return a rendered version of it to the response stream, using something like RenderControl(writer) and write it to my own html writer which is then returned in a Response.Write(), or does it need to be wrapped in another object which I JSON.Serialize() instead? Or what is best/recommended practice if trying to do this?
I notice in your Remote_Load example above, in the source, it generates this bit of relevant script:
Thanks!
I have an ExtJs tab panel created in JavaScript using ExtJs (not Ext.Net. I am not in a position to change this at the moment, unfortunately).
What I'd like to do is when a tab is activated for the first time,
- Make an ajax call to the server
- Generate a grid panel there using Ext.Net, and
- send the generated JavaScript back so I can place it in the tab.
I've seen examples such as these:
- https://examples1.ext.net/#/GridPane...vent_Creation/
- https://examples1.ext.net/#/GridPane...d/Remote_Load/
These are close to what I want, except those examples load their content into a Panel or Window generated using Ext.Net so all the wireup code is already there, whereas my TabPanel is generated directly using ExtJs.
The reason I'd like to get the server to send me a grid panel is that we already have custom code to generate our grids using Ext.Net, so I'd like to reuse that (as we work out the columns and their types on the fly based on some other info) so it is not easy to generate this using ExtJs directly on the client side, which is what I'd otherwise do.
Are there any pointers or examples that I may have missed?
E.g. I am guessing the ajax call could be made to a custom ashx handler which will return the right JavaScript that I then manually invoke/execute and add the resulting grid to the tab. If that is right, I guess in a ProcessRequest of an ashx if I just did a new Ext.Net.GridPanel() could I just return a rendered version of it to the response stream, using something like RenderControl(writer) and write it to my own html writer which is then returned in a Response.Write(), or does it need to be wrapped in another object which I JSON.Serialize() instead? Or what is best/recommended practice if trying to do this?
I notice in your Remote_Load example above, in the source, it generates this bit of relevant script:
directEvents:{click:{fn:function(item,e){var params=arguments;Ext.net.DirectEvent.confirmRequest({control:this});},delay:20}
What is Ext.net.DirectEvent.confirmRequest(). Is that something I should be trying to use?Thanks!
Last edited by Daniil; Dec 08, 2010 at 8:30 PM.
Reason: [CLOSED]