In jqGrid how to do particular column value's cell editable true..I have a one row.Row has a four column.In that I want two column's Cell editable true and two columns cell editable false..What should I do?? give me a solution on this problem
Asked
Active
Viewed 677 times
1 Answers
0
If I correctly understand your question then you can use cellattr
to set "not-editable-cell"
class depend on the value in the column. See the answer for the corresponding code example.
-
Actually, i have no condition over cell. I want only first and second cell of first row editable, not third cell and also not all other rows. Please guide. – Priya Jun 11 '15 at 06:58
-
@Priya: You can examine the `rowId` (the second parameter of `cellattr`) and set "not-editable-cell" on the cell. You should include such `cellattr` callback in the columns of `colModel` which you want protect for editing. You should always identify the row by id and not by position (you wrote about the " first row"). You should think about sorting. After resorting the same row can have another position. – Oleg Jun 11 '15 at 07:07
-
Thanks Oleg. I don't require sorting in grid. so not to worry for that. – Priya Jun 11 '15 at 07:19
-
But, using rowId , how i can identify that this is the first row and first cell only? – Priya Jun 11 '15 at 07:20
-
1@Priya: You should post the demo or at least the JavaScript code with test data which you use. I think that there are basis misunderstanding how jqGrid work. You have to include *id* of every row in the input data. In the way you identify the item of data or the row. Only if you fill the grid in a wrong way then jqGrid will generate ids of the rows automatically as 1,2,3,... – Oleg Jun 11 '15 at 07:25