0

struts2-jqgrid と javascript を使用しています。jqgrid の読み込みがこの get<s:url var="updateurl" action="pagosActualizar"/>を完了し、jqgrid がビュー ソース htmloptions_gridtable.cellurl = "/Cuenta_Corriente_LBS/pagosActualizar.action";で生成されると、問題が発生します。javascript に var があり、この URL にパラメーターを追加したい場合がありますoptions_gridtable.cellurl = "/Cuenta_Corriente_LBS/pagosActualizar.action?cod=1";。この行をjavascriptで編集する形式はありますか?

//JAVASCRIPT

$.subscribe('rowsel', function(event) {
var id = event.originalEvent.rowid;// this is the parameter for the url
var data = jQuery("#gridtable").jqGrid('getRowData',id);
var estado = data['estado.descripcion'];
var cod = data['correlativo'];      
if(estado === 'PENDIENTE'){
    jQuery("#gridtable").jqGrid('setColProp', 'fecha_acuerdo', {editable:true});
            // here cod for edited url in jqgrid
     }
   }

//MYJSP

<s:url var="remoteurl" action="jsontableModificar"><s:param name="codigo"><s:property value="cuentacorriente.idcuentacorriente"/></s:param></s:url>
<s:url var="updateurl" action="pagosActualizar"/>
<sjg:grid
    id="gridtable"
    caption="Plan de Pagos Modificar"
    dataType="json"
    href="%{remoteurl}"
    pager="false"
    gridModel="gridModel"                    
    autowidth="true"
    sortable="true"
    gridview="true"   
    cellEdit="true"  
    cellurl="%{updateurl}"
    onCellSelectTopics="rowsel"                             
>

// ソース HTML を表示

options_gridtable.datatype = "json";
options_gridtable.url = "/Cuenta_Corriente_LBS/jsontableModificar.action?codigo=12";
options_gridtable.cellurl = "/Cuenta_Corriente_LBS/pagosActualizar.action";
options_gridtable.height = 'auto';
options_gridtable.pgbuttons = true;
options_gridtable.pginput = true;
options_gridtable.gridview = true;
options_gridtable.autowidth = true;
options_gridtable.caption = "Plan de Pagos Modificar";
options_gridtable.autoencode = true;
options_gridtable.cellEdit = true;
options_gridtable.oncellselecttopics = "rowsel";

フローは、ユーザーが jqgrid のセルをクリックし、後で行 ID を取得して編集するフィールドを検証するイベントをトリガーすることです。問題は、セルを編集するときに cellurl を使用するが、コンテンツ セルのみを編集対象に送信し、送信しないことです。レジスターの更新に必要な行 ID です。行 ID とセルの内容の 2 つが必要です。

4

2 に答える 2

1

「beforeSubmitCell」イベントを使用できます。ドキュメントは次のリンクにあります。 「beforeSubmitCell」のドキュメント

元。beforeSubmitCell:{cod:cod}.

1 番目の cod はサーバーに投稿された変数の名前です 2 番目の cod は変数の値が JavaScript から取得されます

于 2013-09-13T09:12:09.303 に答える