kaze
kaze

Reputation: 4359

Post non editable values in jqGrid?

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...

Upvotes: 6

Views: 2592

Answers (2)

m3rg
m3rg

Reputation: 688

Just add that to your cell configuration:

editable: true, editoptions: {disabled: true}

Upvotes: 15

Ben Fogel
Ben Fogel

Reputation: 561

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.

Upvotes: 0

Related Questions