Hello,I have a radgrid with some bound columns. In one of the bound columns, it has ImageButton. All I want is Javascript function when I click the button i want to get value of this row of the button.
It means when I click ImageButton 'CizelgeAc' I want to get EKD_ID of this selected row. my javascript function is 'cizelgeAc1(this,event)
Javascript Function :
I got the row index but I couldn't reach value of 'EKD_ID' in this way.
It means when I click ImageButton 'CizelgeAc' I want to get EKD_ID of this selected row. my javascript function is 'cizelgeAc1(this,event)
<
telerik:GridTemplateColumn
HeaderText
=
"Kurs Prog. Çiz."
UniqueName
=
"KursProgCiz"
DataField
=
"EKD_ID"
SortExpression
=
"EKD_ID"
ItemStyle-HorizontalAlign
=
"Center"
HeaderStyle-HorizontalAlign
=
"Center"
AllowFiltering
=
"false"
>
<
ItemTemplate
>
<
asp:ImageButton
ID
=
"CizelgeAc"
CommandName
=
"ES"
runat
=
"server"
CausesValidation
=
"false"
OnClientClick
=
"cizelgeAc1(this,event)"
Visible='<%# (((((string)Eval("EGT_TIPI").ToString() == "V"))) ? true : false) %>'
ImageUrl="~/Images/AddRecord.gif" />
<
asp:Label
runat
=
"server"
Visible='<%# (((((string)Eval("EGT_TIPI").ToString() == "A"))) ? true : false) %>' Text="-"></
asp:Label
>
<%-- <
asp:Image
ID
=
"imageKursProgCiz"
runat
=
"server"
ImageUrl
=
"~/Images/Cancel.gif"
Visible='<%# (((((string)Eval("EGT_TIPI").ToString() == "A"))) ? true : false) %>' /> --%>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
function cizelgeAc1(button, args) {
var row = Telerik.Web.UI.Grid.GetFirstParentByTagName(button, "tr");
//guarantee to get to the table row
while (!(row.id && row.id.indexOf("__") > -1)) {
row = Telerik.Web.UI.Grid.GetFirstParentByTagName(button, "tr");
}
//get index
var index = row.id.split("__")[1];
//get all table data items
var tableId = row.id.split("__")[0];
var tableView = $find(tableId);
tableView.get_dataItems();
//find the data item related to the row id
var dataItem = $find(row.id);
var grid = button;
var MasterTable = EgitimTalepleriRadGrid.get_masterTableView();
var cell= grid.get_masterTableView().get_dataItems()[0].get_cell("EKD_ID").innerHTML;
}
I got the row index but I couldn't reach value of 'EKD_ID' in this way.