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

Many Instances of a Window, one for each row in a grid

2 Answers 157 Views
Window
This is a migrated thread and some comments may be shown as answers.
Jeremy
Top achievements
Rank 1
Jeremy asked on 02 Feb 2012, 02:33 AM

How would one create a new and unique Window for each row in a Kendo Grid?  I only want one instance of the window, and each row comes from the database.

For example imagine a Kendo Grid that shows a hundred open jobs and their status.  Each row has a link that says "Change status". Clicking that link will open a URL, with options.  Upon closing, the grid is refreshed.

Thank you in advance!



2 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 06 Feb 2012, 09:06 AM
Hello Jeremy,

You should create only one window per grid (a <div> augmented by kendoWindow) and use the refresh method of the window when the button in the grid is clicked:

dialog.refresh({
    url: "/changeJobStatus",
    data: { jobId: 10 } // determine this from the row that is clicked
});

If you need more help, please submit some of your code and describe the specific problem that you are experiencing.

All the best,
Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Accepted
Jayalakshmi
Top achievements
Rank 1
answered on 08 Feb 2012, 01:37 PM
step1: Add a Dynamic column to Kendo Grid
 columns: [
                                 {
                                   field:"name",
                                   title:"name"
                                },
                                 {
                               title: "", width: "180px", template: '#= ShwEdit(id)#',
                                filterable: false
                           },
                                                    ],


function ShwEdit(d) {
            return '<input type="button" value="Change status" class="k-button" id="btnstatus" style="height:27px;"  onclick="ShowPop()"/>';
        }

function ShowPop()
{
//write the code for the Kendo window to open
}
Tags
Window
Asked by
Jeremy
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Jayalakshmi
Top achievements
Rank 1
Share this question
or