Forum
14:46
15/06/2012
I have a grid using inline edit that allows adding multiple blank rows, but this is causing some problems.
If I add two or more rows and leave some of them with errors, the other rows (saverow succeeded) turn all columns to read-only, with the exception of a select column (edittype: select) with custom formatter to return the combo box text instead of value.
Here is a sample of my code:
<script type="text/javascript"> jQuery(document).ready(function () { jQuery('#grid').jqGrid({ autowidth:true, datatype:'local', height:'100%', pager:'#pager', rowNum:10, sortname:'User', viewrecords:true, gridComplete: function() {OnGridComplete()}, onSelectRow: function(rowid, status) {OnSelectRow(rowid, status)}, colModel: [ { name:'AlternativeIndex', hidden:true, key:true, index:'AlternativeIndex' },{ name:'UserId', formatter: formatUserAsDropDown, label:'User', sortable:true, width:300, editable:true, edittype:'select', editoptions:{"value":""}, index:'UserId' },{ name:'Permission', formatter:'select', hidden:false, label:'Permission', sortable:true, width:170, editable:true, edittype:'select', editoptions:{"value":"R:Read;W:Write"}, index:'Permission' } ] }); }); </script>
And here is the code for the custom formatter:
function formatUserAsDropDown(cellvalue, options, rowObject) { return rowObject.Username; }
This problem does not occur with Permission column.
PS: I cannot reload the grid after saverow as there maybe have some rows with errors and I have to keep them editable until the user fix these errors and click on Save button again.
Most Users Ever Online: 715
Currently Online:
26 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66