通过JavaScript编辑Gridview行 [英] Gridview Row Editing through JavaScript
问题描述
大家好,
我在Gridview中添加一个文本框和下拉值,点按javascript按钮,在gridview的每个单元格中逐个创建元素排。
我是成功的,直到那个..
但现在我想编辑之前通过javascript在gridviw中添加的记录。
为此,我需要获取点击编辑按钮行的索引。
任何人都可以帮我搞定吗??
注意:我在单元格[0]中添加文本框值,单元格[1]中的下拉值,单元格中的编辑按钮[2]
Kindy Help。
Hi All,,
I am adding a textbox and dropdown value in Gridview on button click through javascript by creating elements one by one in each cell of the gridview Row.
I am successfull till that..
but now i want to edit the records which were previously added in gridviw through javascript.
For that i need to get the index of the row of whom edit button was clicked.
Can anybody help me to get that??
NOTE: I am adding textbox value in cell[0], dropdown value in cell[1], Edit button in Cell[2]
Kindy Help.
推荐答案
你可以使用KendoUI Grid
http://demos.kendoui.com/web/grid/editing-inline.html [ ^ ]
哪个完全是Ja vaScript。请尝试。
You can use KendoUI Grid
http://demos.kendoui.com/web/grid/editing-inline.html[^]
Which is totally JavaScript. Please Try.
在您的编辑按钮上绑定一个点击事件,并获取行对象的索引,如下所示。
Bind a click event on your Edit button and get the index of the row object some thing like below.
var rowIndex =
( #the edit button id')。parent()。parent()。index();
('#your edit button id').parent().parent().index();
这篇关于通过JavaScript编辑Gridview行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!