Hi Abu,
I have a tree grid whit a lookup column(id) on the same table of tree grid. After add new record, in grid the new record is diplayed but there is not in drop down field of Add form (I use for add child to father record). Can you help me? Thanks in advance
2 Answers
Hi Abu
I solved the problem in this way:
in $grid["edit_options"]["beforeShowForm"] and
$grid["add option_options"]["beforeShowForm"] I call refreshlookup()
function refreshlookup() { alldata = $('#list1').jqGrid('getGridParam', 'data'); $('#idfather').html(); //clear list dropdown in form newlistval = ''; for (i = 0; i < alldata.length; i++) { id = alldata[i]['_id_']; title = alldata[i]['chaptertitle']; idfather= $('#list1').getRowData($('#list1').getGridParam('selrow')).idfather; strselected = ''; if(idfather===id) strselected = 'selected'; newlistval += '<option role="option" value="' + id + '" '+strselected+'>' + title + '</option>'; } $('#idfather').html(newlistval); }
Alessandro
Nice work, Thanks for sharing.
Your Answer