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

Inline Edit and Pop Up Edit on same grid

2 Answers 124 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Xinzhou
Top achievements
Rank 1
Xinzhou asked on 17 Jun 2014, 08:23 PM
The grid is set for Inline Edit but on 1 field i would like a Pop Up Edit Template.  Can this be done? 

2 Answers, 1 is accepted

Sort by
0
Xinzhou
Top achievements
Rank 1
answered on 18 Jun 2014, 01:50 PM
I know this is possible but can you point me to the right direction so i can have a better idea on how to get started on this. 

Basically when a cell is clicked and depending on what column it is, i want to open a popup editor for editing.  After doing some research it seems like opening a kendo window is the way to go, but i cannot get the column name or column index of the cell that is clicked.  

Thanks.
0
Daniel
Telerik team
answered on 19 Jun 2014, 11:58 AM
Hello,

I posted my reply to the support ticket that you have opened on the same topic. For convenience, I am pasting the relevant part below:

You could use the grid cellIndex method to get the index and get the column name from the grid columns array e.g.
grid.tbody.on("click", "td", function (e) {
    var index = grid.cellIndex(this);
    var column = grid.columns[index];
    var colName = column.field;

An alternative solution to finding the clicked column field name in the handler is to add a specific class or attribute to the column via the HtmlAttributes method:
columns.Bound(o => o.Station).HtmlAttributes(new { @class = "stationCell" });
and filter the cells for which the event should be triggered:
grid.table.on("click", "td.stationCell", function (e) {

 
Also, note that if the handler is bound to the table body and not to the table then it will not be called in older versions of IE. Because older versions do not support setting the innerHTML to a tbody element, the grid will replace the entire table content and the tbody element to which the event is bound will no longer exist.


Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Xinzhou
Top achievements
Rank 1
Answers by
Xinzhou
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or