2016-04-23 10 views
0

私のプロジェクトは、Spring MVC + Hibernate + MySQL、JSP、JQGrid 5.1です。私はJQGrid の行の機能を削除する典型的な状況に直面しています。私は 'oper'と 'id'の他に2つ以上のパラメータをコントローラに渡したいと思っています。 1つのパラメータは文字列で、問題なく渡すことができますが、別のパラメータはコンボボックスから選択された値ですが、ここでは次のコードセグメントでコンボボックスアイテムの単純選択値の代わりにHTML全体を取得します。私は 'cmpcode' が選択された値として取得していますJQGrid 5.1 - getCellは、選択したコンボボックスの値の代わりにhtml全体を返します。

結果のHTMLは以下の通りです:削除行に対して

<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> 

コードセグメントは以下の通りである:ここでは

  { 
      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; 
         }  

、cmpcodeはAですJQGridとそのモデルでのコンボボックスは以下の通りです:

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:'*'}} 

私はコンボボックスの選択された値を取得したいです私は取得していない、私を案内してください、私はまた 'getCell'メソッドを試してみましたが、価値を得ることはありません。

答えて

0

私は、次のリンクで「パヴェル」で

How to get a jqGrid cell value when editing

に答えてきたとして、次のコードをdropdrowlistボックスの列のセルの値を得ることに成功しましたありがとうございました。

関連する問題