Hi
I have a tree with context menus on it. When a user selects an option saying "Edit" , a modal window should popup showing another tree view or a list from which the user selects a node and hits a submit. I should be able to retain the selection made by the user on the second tree and use it to make some changes in the current tree. Is there a way of doing that
I am not sure on the following:
1. Opening a modal window, this window would have stuff like text boxes, buttons and an other tree view inside of it.
2. Retain the value of the node that the user selects on the tree view on the modal window..
3. Use the retained value to make some changes on the tree view on the parent page from which the modal window pops up.
Can you please send in some code samples or documentation that i can refer to.
Any help is greatly appreciated.
Thanks,
11 Answers, 1 is accepted
0
Hi Rishi,
I would suggest to check the Client-Side section of the RadWindow control in the documentation for more information on how RadWindow works. As for the RadTreeview, there is a lot of information that will be of help in the Client-Side programming and in the How-to sections of the documentation.
Sincerely yours,
Georgi Tunev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
I would suggest to check the Client-Side section of the RadWindow control in the documentation for more information on how RadWindow works. As for the RadTreeview, there is a lot of information that will be of help in the Client-Side programming and in the How-to sections of the documentation.
Sincerely yours,
Georgi Tunev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Rishi
Top achievements
Rank 1
answered on 12 Mar 2010, 02:45 PM
Hi Georgi
Thanks for replying. I did have a look at the client side API for the tree view, the problem is none of the controls are being recognized on my parent page. I had a document.getelementbyID and it is returning a null object, this is happening with all the elements on my pages in the project.
I am not sure why this is happening this way? I had the radscript manager etc and all properly placed as well. I am just not able to access the elements on my page from the client code and i am not sure how to debug these errors as well.
Do you have any idea why it would happen this way?
0
Hi Rishi,
Our controls create a client-side object with the ClientID of the corresponding control. In order to use it you should obtain the reference to it by using the $find() function and passing in the ClientID of the control.
For example:
More information on the subject is available here.
Greetings,
Georgi Tunev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Our controls create a client-side object with the ClientID of the corresponding control. In order to use it you should obtain the reference to it by using the $find() function and passing in the ClientID of the control.
For example:
var
tree = $find(
"RadTreeView1"
);
// or...
var
tree = $find(
"<%= RadTreeView1.ClientID %>"
);
Greetings,
Georgi Tunev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Rishi
Top achievements
Rank 1
answered on 12 Mar 2010, 03:41 PM
$find() is a method from the jquery right should I have some library or dll included in my project to use $find()? because it didn't get back the controls for me even if i used the $find() ealier?
0
Hi Rishi,
$find() is ASP.NET AJAX shortcut - as long as you have asp:scriptmanager or telerik:radscriptmanager controls on the page, you will be able to use it.
Regards,
Georgi Tunev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
$find() is ASP.NET AJAX shortcut - as long as you have asp:scriptmanager or telerik:radscriptmanager controls on the page, you will be able to use it.
Regards,
Georgi Tunev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Rishi
Top achievements
Rank 1
answered on 12 Mar 2010, 04:49 PM
Oh Great!!!
This var treeView = $find("<%= OverRideTreeView.ClientID %>"); worked Georgie.
May be the last time I tried i didn't give the spaces and all in the right way.
Thanks a ton :)
0
Rishi
Top achievements
Rank 1
answered on 12 Mar 2010, 07:41 PM
Hi Georgi
I have a similar kind of a problem when I was trying to open a radwindow modally, when a contex menu item is selected, but been running to an error and the JS breaks here:
window.radopen=function(e,d){var f=GetRadWindowManager();
return f.open(e,d)
f is undefined and an error saying Property not supported on the object is returned.
This is the code or java script that I am using:
function ShowDialog()
{
window.radopen("popUp.aspx?Type=Override","rwnpopUP");
}
and from the code behind I am calling this function in the following manner:
Page.ClientScript.RegisterStartupScript(this.GetType(), "call", "<script type='text/javascript'> ShowDialog();</script>");
Thanks
0
Hello Rishi,
The error is expected. When you try to access RadWindowManager (by using radopen), it is still not fully rendered on the page - just like any other ASP.NET AJAX control. More information on the subject and different solutions are available here:
http://blogs.telerik.com/supportdept/posts/09-05-05/executing_javascript_function_from_server-side_code.aspx
By the way, in the scenario that you have, you could also open the RadWindow directly from codebehind by setting its VisibleOnPageLoad property to true.
All the best,
Georgi Tunev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
The error is expected. When you try to access RadWindowManager (by using radopen), it is still not fully rendered on the page - just like any other ASP.NET AJAX control. More information on the subject and different solutions are available here:
http://blogs.telerik.com/supportdept/posts/09-05-05/executing_javascript_function_from_server-side_code.aspx
By the way, in the scenario that you have, you could also open the RadWindow directly from codebehind by setting its VisibleOnPageLoad property to true.
All the best,
Georgi Tunev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Rishi
Top achievements
Rank 1
answered on 17 Mar 2010, 01:39 PM
Hi Georgi
I wouldn't need the window to be visible on a page load.. What I want is: I have a treeview1 on say page1.aspx... when a contex menu item is selected on the treeview1 node I have to open a page2.aspx as a rad window.
The user then makes some selections in the page2.aspx and hits submit on the page2.aspx.. now I should retain what ever values that are selected on the page2 and use those to remove or create new nodes on the treeview1 on the page1.aspx.
I was trying to use the client side api of the treeview on my page1 but the error arises when i try to open the page2.aspx as a popup from my code behind ..
Can you please let me know a work around for this?
Thanks
0
Hello Rishi,
How exactly do you open the RadWindow? Also, do you have a RadWindowManager on that page?
Best wishes,
Georgi Tunev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
How exactly do you open the RadWindow? Also, do you have a RadWindowManager on that page?
Best wishes,
Georgi Tunev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Rishi
Top achievements
Rank 1
answered on 25 Mar 2010, 01:05 PM
Hi
Thanks for all your support I got it figured out:
I just inserted the JavaScript part rather the rad code block that contains the window open code accessing the controls on the page at the end of the .aspx/.ascx page so that all the controls are recognized by the time control i passed to the JavaScript part and used a Page.ClientScript.RegisterStartupScript [since a RegisterStartupScript places the script at the end of the page as opposed to the Page.ClientScript.RegisterClientScriptBlock which inserts the script at the top of the .aspx page] to call the JavaScript function from the code behind.
Rishi