This is a migrated thread and some comments may be shown as answers.

[Solved] Detail View with Pop-Up Mode

5 Answers 289 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Albert
Top achievements
Rank 2
Albert asked on 16 Aug 2011, 11:34 PM
Hi,

I'm new in telerik, can anyone help me?

I need to make details view by using button that just like the edit button,

so when i click the details button, the pop-up window will show with the details i need.

is there any way to do that by using telerik?

i'm using telerik 2011.7.712 and using MVC 3 with Razor View.

Thanks,

Albert

5 Answers, 1 is accepted

Sort by
0
Matt
Top achievements
Rank 1
answered on 17 Aug 2011, 02:55 AM
You could handle the onRowSelected event of the Grid, as seen here:
http://demos.telerik.com/aspnet-mvc/grid/clientsideevents

And when a user selects the grid, create a window in JavaScript, like this:
http://demos.telerik.com/aspnet-mvc/window/clientsideapi  (see the portion where they open and close the window).

Or you can create the Window from scratch in JavaScript, like this:
var windowElement = $.telerik.window.create({
       title: "Window Title",
       html: 'HTML to display your row details',
       modal: false,
       resizable: true,
       draggable: false,
       scrollable: false,
       width: 300,
       height: 300
   });

Hope this helps!
0
Albert
Top achievements
Rank 2
answered on 17 Aug 2011, 03:49 AM
Hi, Matt, thanks for the answer,

i tried it, but there's no response when i click the select row button

here's the Client Events

.ClientEvents(events => events
    .OnRowSelect("onRowSelect"))

and this is the java script
<script type="text/javascript">
 
function onRowSelect(e) {
        var row = e.row;
        var window = $("#Window").data("tWindow");
        window.open();
 
    }
</script>

and this is the windows form :

@{  Html.Telerik().Window()
        .Name("Window")
        .Title("Details")
        .Width(400)
        .Draggable(true)
        .Modal(true)
        .Visible(false)
        .Render();
}

i'm actually using server side scripting for my project, and it seems that client side script is not working at all.

do you have other idea to do that? or maybe there's something wrong in my script?

Thank you in advance
0
Matt
Top achievements
Rank 1
answered on 17 Aug 2011, 04:01 AM
Is there a response at all?  What happens if you remove the window open code and just write to the console (using firebug or something similar)?  Is the onRowSelect being fired at all?
0
Albert
Top achievements
Rank 2
answered on 18 Aug 2011, 03:55 AM
no, matt, there's no response and it's not fired at all,

the script is detected by firebug too, but not fired at all.

well, i write on console "onRowSelect(1)" and the windows is shown, so maybe the trouble is on the event. i'll try it.

thanks matt.
0
Albert
Top achievements
Rank 2
answered on 18 Aug 2011, 04:11 AM
Solved Matt, thank You very much,
here's the solution, maybe the row select only work for client side, if using server side it won't work
the javascript for windows is still the same :
<script type="text/javascript">
 
function onRowSelect(e) {
        var row = e.row;
        var window = $("#Window").data("tWindow");
        window.open();
 
    }
</script>

the difference only in client events :
.ClientEvents(events => events
                    .OnDetailViewCollapse("onRowSelect")
                    .OnDetailViewExpand("onRowSelect")
                    )

so whenever i click the detail view button on left, the windows open. :)
Tags
Grid
Asked by
Albert
Top achievements
Rank 2
Answers by
Matt
Top achievements
Rank 1
Albert
Top achievements
Rank 2
Share this question
or