如何处理jQuery网格中的行单击事件 [英] How to handle row click event in jQuery grid

查看:73
本文介绍了如何处理jQuery网格中的行单击事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含用户数据和数据的jQuery网格.单击时,我需要处理每个网格行的网格行单击,我需要在网格底部显示其他网格.

I have a jQuery grid with data with user data. I need to handle the click on grid row for each grid row when I click I need to display other grid in the bottom of the grid.

类似这样的东西:

http://www.trirand.com/blog/jqgrid/jqgrid.html

转到高级--->主要详细信息

Go to Advanced ---> master details

谢谢

推荐答案

onSelectRow使详细信息网格从主网格加载信息.

the onSelectRow is what is making the details grid load the information from the master grid.

   onSelectRow: function(ids) { 
            if(ids == null) {
                    ids=0; 
                    if(jQuery("#list10_d").jqGrid('getGridParam','records') >0 ) 
                    { 
                        jQuery("#list10_d").jqGrid('setGridParam',{url:"subgrid.php?q=1&id="+ids,page:1});
                        jQuery("#list10_d").jqGrid('setCaption',"Invoice Detail: "+ids) 
                        .trigger('reloadGrid'); 
                    }
                } else { 
                    jQuery("#list10_d").jqGrid('setGridParam',{url:"subgrid.php?q=1&id="+ids,page:1}); 
                    jQuery("#list10_d").jqGrid('setCaption',"Invoice Detail: "+ids)
                    .trigger('reloadGrid');
                } 
        }

这篇关于如何处理jQuery网格中的行单击事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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