Forum



08:55

27/10/2010

Thank you for a great plugin!
I have a strange problem and after a lot of research,
I am unable to find a solution. I hoping that I might find help here...
I have a grid with a select box and rows are editable inline.
After I put one line in edit mode, if I perform a save (double click on another row or Enter),
and then edit the same line again, the dropdown loses it value (even though it is in the DB).
I have to reload the grid to get the correct value in the dropdown.
Any idea what might cause the problem?
Here is a bit of the code:
jQuery("#taxcodes_list").jqGrid({
url:vUrl,
datatype: "json",
colNames: ['code', 'description', 'percentage', 'account_for_tax_collected', 'account_for_tax_paid'],
colModel: [{name:'code', index:'code', width:70, search:true, stype:'text', searchoptions: { sopt: ['eq', 'ne', 'cn']}, editable: true, editoptions:{size:'10',maxlength:'10'}, editrules:{required:true}},{name:'description', index:'description', search:true, stype:'text', searchoptions: { sopt: ['eq', 'ne', 'cn']}, editable: true, editoptions:{size:'50',maxlength:'255'}},{name:'percentage', index:'percentage', width:70, align:'right',formatter:'currency', search:true, stype:'text', searchoptions: { sopt: ['eq','ne','lt','le','gt','ge']}, editable: true, editoptions:{size:'5',maxlength:'5'}, editrules:{number:true, minValue:0, maxValue:100}},{name:'actaxcollected_id', index:'actaxcollected_id', search:false, editable: true, edittype:'select', editoptions:{buildSelect:myBuildSelect, dataUrl:'http://localhost/CAN2007070117121801/lists/accounts'} },{name:'actaxpaid_id', index:'actaxpaid_id', search:false, editable: true, edittype:'select', editoptions:{buildSelect:myBuildSelect, dataUrl:'http://localhost/CAN2007070117121801/lists/accounts'} }],
rowNum:25,
rowList:[15,25,50,100],
pager: '#taxcodes_pager',
sortname: "code",
sortorder: "asc",
prmNames : {search:"search"},
autowidth:true,
height: '100%',
viewrecords:true,
multiselect: false,
ondblClickRow: function(id){
if (!update_access) return false;
if(id && id!==lastSel){
jQuery('#taxcodes_list').jqGrid('restoreRow', lastSel);
lastSel=id;
}
jQuery('#taxcodes_list').jqGrid('editRow', id, true);
},
editurl: vEditUrl
});
});
Thanks for your help!
04:27

27/10/2010

Hi, I have been using this:
function buildListsSelect(response) {
if(typeof(response) == "object") {
response = response.responseText;
}
var html = '<select>';
var data = JSON.parse(response);
for(var i in data) html += '<option value="' + i + '">' + data[i] + '</option>';
html += '</select>';
return html;
}
Hope this helps.
Most Users Ever Online: 715
Currently Online:
51 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