1

jqGrid 4.5.4 を使用して jqGrid を構築しています。コンボボックスの編集に問題があります。私のコンボボックスには都市名があります。コンボ ボックスには、名前が同じでキー値が異なる 2 つの都市があります。jqgrid ドロップダウンの行を編集しているときに、異なるケイ値の都市が入力されました。使用しformatter:'select'ました。しかし、それは機能していません。

私のコードは次のとおりです::

var jQuery = $.noConflict();
var lastSel = 0;
jQuery(document).ready(function(){
    jQuery.ajax({
        // The link we are accessing.
        url: <%= "'" +url_1.toString()+"'"%>,
        // The type of request.
        type: "get",
        // The type of data that is getting returned.
        dataType: "json"
    }).done(function(data){
            jQuery("#list2").jqGrid({
                url:<%= "'" +url.toString()+"'"%>,
                datatype:"json",
                mtype:"POST",
                colNames:['localityId','City','Locality'],
                colModel:[
                    {
                            name:'localityId',
                            index:'localityId',
                            width:240,
                            key:true,
                            editrules:{edithidden:false, required:true},
                            editable:true,
                            hidden:true
                    },
                    {
                            name:'cityId',
                            index:'cityId',
                            width:240,
                            editable:true, 
                            edittype:'select',
                            formatter:'select',
                            sortable:true,
                            editrules:{ required:true},
                            editoptions: {  
                                value:  data                                            
                            }       
                    },
                    {
                            name:'locality',
                            index:'locality', 
                            width:240,
                            sortable:true,
                            editable:true, 
                            edittype:'text'
                    }
                ],
                rowNum:10, 
                rowList:[10,20,30], 
                pager: '#pager2', 
                sortname: 'locality',
                editurl:<%= "'" +url_edit.toString()+"'"%>,
                viewrecords: true,
                multiselect: true, 
                sortorder: "desc", 
                caption:"Locality Master"
            });

            jQuery("#list2").navGrid(
                                      '#pager2',
                                      {add:true, edit:true, del:true},
                                      {},
                                      {},
                                      {},
                                      {}
                                    );
    });
});

formatter='select' が削除された場合、cityId が画面に表示され、行が編集された場合、正しい都市がドロップダウンで選択されます。formatter='select' と editoption の問題は何ですか。

4

1 に答える 1