Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
Dropdown loses value at second time inline edit
27/10/2010
08:55
Avatar
Caroline
Australia
Member
Members
Forum Posts: 4
Member Since:
27/10/2010
sp_UserOfflineSmall Offline

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(document).ready(function(){
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!

02/12/2010
00:36
Avatar
johan
USA
Member
Members
Forum Posts: 13
Member Since:
02/12/2010
sp_UserOfflineSmall Offline

Hi, I was wondering what you are doing for "myBuildSelect", I am having issues getting data to populate into a multiselect: true on edit.

Thanks!

02/12/2010
04:27
Avatar
Caroline
Australia
Member
Members
Forum Posts: 4
Member Since:
27/10/2010
sp_UserOfflineSmall Offline

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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
40 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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information