我已将自定义滚动条应用于div“ ui-jqgrid-bdiv”,jqgrid的排序不起作用。没有自定义滚动条的排序工作正常。应用自定义滚动条后,单击列后,将显示空白网格。

码:-

 $(window).load(function(){
                $(".FilterContainer,.ui-jqgrid-bdiv").mCustomScrollbar({
                    scrollButtons:{enable:true},
                    theme:"light-thick"
                });
});
     jQuery(gridOption).jqGrid({
    data: applyBestMachineData,
    datatype: "local",
    colNames:[displayName,'', 'kA$','%','kA$','%','kA$','%'],
    colModel:[
        {name:'machineBestMachine',index:'machineBestMachine',width:350, sortable: false,classes: "machineBestMachinecol"},
        {name:'machineValue',index:'machineValue', width:60,sortable: false, classes: "machineValue"},
        {name:'applyBestMachineValue',index:'applyBestMachineValue', width:75,sortable: true, classes: "col2",sorttype:"text"},
        {name:'applyBestMachinePer',index:'applyBestMachinePer', width:75, align:"center", sortable: true,classes: "col1",sorttype:"text"},
        {name:'applyBestMachineOperation',index:'applyBestMachineOperation', width:65, align:"center",sortable: true, classes: "col2",sorttype:"text"},
        {name:'applyBestMachineOperationPer',index:'applyBestMachineOperationPer', width:65,align:"right", sortable: false,classes: "col1"},
        {name:'applyBothValue',applyBothValue:'applyBothValue', width:65,sortable: false, classes: "col2"},
        {name:'applyBothPer',index:'applyBothPer', width:65,sortable: false, classes: "col1"}
    ],
    rowNum:2000,
    rowTotal: 2000,
    scroll:1,
    loadonce:true,
    mtype: "GET",
    rownumWidth: 40,
    gridview: true,
    autowidth: true,
    height:gridHeight,
    //sortable: false,
    viewrecords: true,
    onSelectRow: function(id) {
        var rowData = jQuery(this).getRowData(id);
        var machineBestMachineVar = rowData['machineBestMachine'];
        var machineBestMachineValue = machineBestMachineVar.split('<');
        openEvaluationItemDetailPopUp(machineBestMachineValue[0]);
    },
    loadComplete: function() {
        //alert(this);

        $(gridOption+" tr:even").addClass('myAltRowClassEven');
         $(gridOption+" tr:odd").addClass('myAltRowClassOdd');

            // $("#applyMachineGrid tr:even").addClass('myAltRowClassEven');
            // $("#applyMachineGrid tr:odd").addClass('myAltRowClassOdd');

         }
});

最佳答案

我得到答案:-
  只需删除scroll = 1属性

10-06 15:17