Post non editable values in jqGrid?
Asked Answered
P

2

6

I'm using jqGrid, and I would like to post non editable values to the server. I'm editing row by row (not form). Is that possible?

The column is visible, and I'm using inline editing. The data is posted using "editurl" property of the grid.

** Solution ** I solved it in a completely different way, by not using jqGrids setCell, but instead setting the textbox value using document.getElementById(selr + "_Verksamhetskod").value = data.

Not exactly what I had in mind initially, but it works...

Pipestone answered 22/5, 2012 at 11:5 Comment(2)
Do you need post the values from hidden or visible columns? Which editing mode exactly you use? Is it inline editing? Do you use it directly or you use formatter: "actions", inlineNav etc?Mentalism
I have updated the question. I'm not sure about your last question though. This quesion is related to #10699522 , where a cell becomes uneditable after I set a value.Pipestone
L
15

Just add that to your cell configuration:

editable: true, editoptions: {disabled: true}

Laceration answered 29/6, 2012 at 9:2 Comment(0)
R
0

Well if I'm understanding correctly you are trying to make a cell become read-only once it has a value but still be in a format where you can post to the server correctly.

You could use Jquery to place a read-only attribute on each input field

$("#PrimaryKey".columnName").attr("disabled", true)

and either fire this code if there is a value in the input field or after an input has been entered.

Rissole answered 22/5, 2012 at 21:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.