RESET按钮也在Jqgrid中刷新过滤器栏. [英] The RESET button is refreshing the filter bar as well in Jqgrid.?

查看:54
本文介绍了RESET按钮也在Jqgrid中刷新过滤器栏.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在重置时遇到问题,如您所见,我已将状态默认设置为活动",并且只能选择一条记录,在选择记录用户之后,可以单击添加WO"

I Have a problem in the reset, as you see i have set the status default as ACTIVE, and only one record can be selected, after selecting the record user can click ADD WO

http://i48.tinypic.com/11udoo6.jpg

但是,当单击重置"按钮时,整个状态栏都会更改

But when click on the Reset button the whole status bar changes

http://i45.tinypic.com/25a6vcp.jpg

我还将dafaultvalue也设置为ACTIVE. 重置时,我必须保持状态为活动状态.

I also set the dafaultvalue to ACTIVE also..!! I Have to keep the status active, when it resets..!!Plz help me

function initJqGridSearchSubProject(table,pager,msg,loadSelID,caption,chkMrk ){

 $(table).empty();
 $(table).GridUnload();
 var mygrid =jQuery(table).jqGrid({
    datatype: "local",      
    data:msg,   
    width: 1240,
    scrollOffset:0,     
    height: 250,
    colNames:['ID','PID','Project Folder Name','Sub Project Name','Responsible','Status','Last Updated On'],
    colModel:[
    {name:'id',index:'id',hidden:true, width:5, sorttype:"int", editable: false,resizable:false},
    {name:'pid',hidden:true, width:5, sorttype:"int", editable: false,resizable:false},
    {name:'projectFolderName', width:250, editable: true,formatter:'tsLinks'},
    {name:'subProjectName', width:250, editable: true,formatter:'subProjectLinks'},
    //{name:'eCNNumber', width:150, editable: true},                
    {name:'responsible', width:200, editable:false,resizable:false},
    {name:'status', width:100,editable: true,stype:'select',edittype:"select",resizable:false,searchoptions:{defaultValue:"ACTIVE"},editoptions:{value:"ACTIVE:ACTIVE;INACTIVE:INACTIVE;DELETED:DELETED",readonly:false},editrules:{edithidden:false}}, 
    {name:'lastUpdatedOn', width:200,editable: false,resizable:false,sorttype:'date',formatter:'date',formatoptions:{ srcformat: 'M d y H:i:s', newformat: 'd M y h:i A' }}

        ],
    pager: pager,
    rowNum:200,     
    rowList:[200,400,600,1000],
    //rowTotal:2000,                    
    //loadOnce:true,    
    //rownumbers:true,
    gridview : true,
    sortname: 'lastUpdatedOn',                  
    viewrecords: true,
    sortorder: "desc",                  
    toppager:true,
    multiselect:true,
    singleselect: false, 
    //multiboxonly:true,
    //toolbar: [true,'both'],                   
    caption:caption,
    hidegrid: false,
    gridComplete:function(id){
    //$(chkMrk).hide();
    //alert('grid complete');
    },
    beforeSelectRow: function(rowid, e)
    {
        // reset check box selection only when user clicks on another checkbox
        if($(e.target).is("input:checkbox"))
        {
            // reset/clear other checkboxes selection before making a latest clicked row's checkbox as selected
            jQuery(table).jqGrid('resetSelection');
        }

        // Code To Disable Check Box Selection When User Selects by Clicking on A Row
        return $(e.target).is("input:checkbox");
        //return(true);
    }

}); 
jQuery(table).jqGrid('navGrid',pager,{del:false,add:false,edit:false,search:false,refresh:true,cloneToTop:true,afterRefresh:function(){}},{},{},{},{}); 
jQuery(table).jqGrid('navButtonAdd', table+ '_toppager_left',{caption:"Add WO", buttonicon:"ui-icon ui-icon-plus",id:"SUBPROJID", onClickButton: function(){},position:"first",title:"Add WO"});

推荐答案

最后得到了结果,我只是在reset按钮功能内添加了triggerToolbar().

Finally got the result, i just added the triggerToolbar() inside the reset button function.

jQuery(table).jqGrid('navGrid',pager,{del:false,add:false,edit:false,search:false,refresh:true,cloneToTop:true,afterRefresh:function(){$(table)[0].triggerToolbar();}},{},{},{},{});

现在可以正常工作了!!

And now its working fine..!

这篇关于RESET按钮也在Jqgrid中刷新过滤器栏.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆