0

My project is Spring MVC + Hibernate + MySQL and JSP and JQGrid 5.1 as a front end. I am facing typical situation where, in JQGrid delete row functionality, I want to pass two more parameters to controller in addition to 'oper' and 'id'. One parameter is string and I am able to pass it without any issue, however another parameter is a selected value from the combo box, here in the following code segment, I get the entire HTML instead of simple selected value of combo box item.

resultant HTML which I am getting as a selected value of 'cmpcode' is as below:

<select role="select" class="editable inline-edit-cell ui-widget-content ui-corner-all" id="3_cmpcode" name="cmpcode" rowid="3">null<option value="1" role="option">Test Company</option><option value="2" role="option">Test-2-new</option><option value="3" role="option">Niyogi Enterprise</option><option value="4" role="option">Test-4</option><option value="5" role="option">SySoft Computers</option><option value="6" role="option">Rohi-Nirag</option><option value="7" role="option">TYB and Co</option></select>

Code segment for delete row is as below:

         {
            caption: "Delete Branch Master",
            msg: "Delete selected Branch?",
            bSubmit: "Delete",
            bCancel: "Cancel",
            reloadAfterSubmit:true,
            closeOnEscape:true,
            onclickSubmit : function(eparams) {
                         var rowData = $("#list").jqGrid('getRowData', row_selected);

                         var retarr = {'brcode':rowData['brcode'],'cmpcode':rowData['cmpcode']};
                         return retarr;
                         }    

Here, cmpcode is a combo box in JQGrid and its model is as below:

colModel:[
                    {name:'brcode',index:'brcode', width:50, editable:true, editrules:{required:true}, editoptions:{size:10}, formoptions:{elmprefix:'*'}},
                    {name:'brname',index:'brname', width:100, editable:true, editrules:{required:true}, editoptions:{size:30}, formoptions:{elmprefix:'*'}},
                    {name:'bradd1',index:'bradd1', width:100, editable:true, editoptions:{size:30, maxlength:60}, formoptions:{elmprefix:'*'}},
                    {name:'bradd2',index:'bradd2', width:100, editable:true, editoptions:{size:30, maxlength: 60}, formoptions:{elmprefix:'*'}},
                    {name:'brcity',index:'brcity', width:50, editable:true, editoptions:{size:20, maxlength:30}, formoptions:{elmprefix:'*'}},
                    {name:'brpin',index:'brpin', width:50, editable:true, editoptions:{size:20,maxlenght:6}, editrules:{required:true,number:true},formoptions:{elmprefix:'*'}},
                    {name:'bremail',index:'bremail', width:75, editable:true, editoptions:{size:30}, editrules:{required:true,email:true}, formoptions:{elmprefix:'*'}},
                    {name:'brcontactperson',index:'brcontactperson', width:75, editable:true, editoptions:{size:30}, formoptions:{elmprefix:'*'}},
                    {name:'cmpcode',index:'cmpcode',editable:true,edittype:'select',editoptions:{dataUrl:"/NioERPJ/admin/branchmstmgmt/listCmps"},formoptions:{elmprefix:'*'}}

I want to get selected value of combo box, which I am not getting, please guide me, I have also tried through 'getCell' method, but not getting value.

falcon
  • 177
  • 1
  • 3
  • 16

1 Answers1

0

I was successful in getting the cell value for dropdrowlist box column through following code as has been answered by 'Pawel' in following link

How to get a jqGrid cell value when editing

Thank you very much.

Community
  • 1
  • 1
falcon
  • 177
  • 1
  • 3
  • 16