如何在jqGrid表中隐藏id列?

时间:2011-06-18 11:19:43

标签: jquery jqgrid

这是我的代码,请帮我隐藏jqGrid中的id列,我假设为了选择当前行我将需要此id列,但不要让它闪烁我的桌子

enter image description here

更新了ospatches

var ospatches=[];

$(xml).find('patch').each(function(){ 
    var row={};
    row.name=$(this).attr('name');
    ospatches.push(row);
});


$('#detailTable').empty();
$('<div width="100%">')
.attr('id','ospatchesSpan')
.html('<div class="titleBlue">Configuration&gt;System&gt;Os Patches</div>'+
        '<table id="list1" width="100%"></table>'+
        '<div id="gridpager"></div>'+
    '</div>')        
.appendTo('#detailTable');    



jQuery("#list1").jqGrid({
    datatype: "clientSide",
    height: 250,
       colNames:['Name'],
       colModel:[
           {name:'name',index:'name', align:"right"},

       ],
       pagination:true,
       pager : '#gridpager',
       rowNum:10,
       scrollOffset:0,
       height: 'auto',
       autowidth:true,
    viewrecords: true,
    gridview: true,
    edit:false,
    add:false,
    del:false

});



for(var i=0;i<ospatches.length;i++)
    jQuery("#list1").jqGrid('addRowData',i+1,ospatches[i]);

jQuery("#list1").setGridParam({rowNum:10}).trigger("reloadGrid");

这是我的数据花了太长时间..我只发布了一半,与filesystem相同的位置

<ospatches>
<patch name='gnome-kerberos-0.3.3-1' />
<patch name='cdecl-2.5-30' />
<patch name='sr_mod-Dell_RHEL4a-4dkms' />
<patch name='gsk7bas-7.0-3.18' />
<patch name='pdksh-5.2.14-30.3' />
<patch name='IBM_db2chen81-8.1.3-136' />
<patch name='IBM_db2icms81-8.1.3-136' />
<patch name='perl-String-CRC32-1.4-2.fc6' />
<patch name='nc-1.84-10.fc6' />
<patch name='libdv-0.104-4.fc6.1' />
<patch name='specspo-13-1.el5' />
<patch name='system-config-services-0.9.4-1.el5' />
<patch name='rp-pppoe-3.5-32.1' />
<patch name='cyrus-sasl-2.1.22-4' />
<patch name='xmlsec1-1.2.9-8.1' />
<patch name='libXvMC-1.0.2-2.1' />
<patch name='automake15-1.5-16' />
<patch name='swig-1.3.29-2.el5' />
<patch name='automake-1.9.6-2.1' />
<patch name='curl-devel-7.15.5-2.el5' />
<patch name='cvs-1.11.22-5.el5' />
<patch name='xorg-x11-fonts-misc-7.1-2.1.el5' />
<patch name='xorg-x11-drv-tek4957-1.1.0-1.1' />
<patch name='gtk+-1.2.10-56.el5' />
<patch name='xorg-x11-resutils-7.1-2.fc6' />
<patch name='scim-qtimm-0.9.4-5' />
<patch name='kde-i18n-French-3.5.4-1' />
<patch name='setup-2.5.58-4.el5' />
<patch name='words-3.0-9.1' />
<patch name='bash-3.2-24.el5' />
<patch name='libICE-1.0.1-2.1' />
<patch name='libgpg-error-1.4-2' />
<patch name='pkgconfig-0.21-2.el5' />
<patch name='slang-2.0.6-4.el5' />
<patch name='libogg-1.1.3-3.el5' />
<patch name='desktop-file-utils-0.10-7' />
<patch name='ORBit2-2.14.3-5.el5' />
<patch name='flac-1.1.2-28.el5_0.1' />
<patch name='crash-4.0-7.2.3' />
<patch name='traceroute-2.0.1-5.el5' />
<patch name='libvorbis-1.1.2-3.el5_1.2' />
<patch name='libidn-0.6.5-1.1' />
<patch name='libXinerama-1.0.1-2.1' />
<patch name='libXfontcache-1.0.2-3.1' />
<patch name='perl-libwww-perl-5.805-1.1.1' />
<patch name='startup-notification-0.8-4.1' />
<patch name='e2fsprogs-libs-1.39-20.el5' />
<patch name='module-init-tools-3.3-0.pre3.1.42.el5' />
<patch name='dmraid-1.0.0.rc13-33.el5' />
<patch name='m2crypto-0.16-6.el5.3' />
<patch name='nss_ldap-253-17.el5' />
<patch name='pycairo-1.2.0-1.1' />
<patch name='xorg-x11-xinit-1.0.2-15.el5' />
<patch name='newt-0.52.2-12.el5' />
<patch name='util-linux-2.13-0.50.el5' />
<patch name='gtk2-2.10.4-20.el5' />
<patch name='fipscheck-1.0.3-1.el5' />
<patch name='smartmontools-5.38-2.el5' />
<patch name='dbus-glib-0.73-8.el5' />
<patch name='kudzu-1.2.57.1.21-1' />
<patch name='pciutils-devel-2.2.3-5' />
<patch name='strace-4.5.18-2.el5' />
<patch name='perl-IO-Socket-INET6-2.51-2.fc6' />
<patch name='mysql-5.0.45-7.el5' />
<patch name='php-ldap-5.1.6-23.el5' />
<patch name='perl-IO-Socket-SSL-1.01-1.fc6' />
<patch name='redhat-artwork-5.0.9-1.el5' />
<patch name='vsftpd-2.0.5-12.el5' />
<patch name='openssl-devel-0.9.8e-7.el5' />
<patch name='sane-backends-1.0.18-5.el5' />
<patch name='libgnome-2.16.0-6.el5' />
<patch name='nautilus-extensions-2.16.2-7.el5' />
<patch name='librsvg2-2.16.1-1.el5' />
<patch name='xorg-x11-drv-mouse-1.1.1-1.1' />
<patch name='system-config-httpd-1.3.3.3-1.el5' />
<patch name='scim-doc-1.4.4-41.el5' />
<patch name='libgcj-devel-4.1.2-44.el5' />
<patch name='kdebase-3.5.4-19.el5' />
<patch name='scim-libs-1.4.4-41.el5' />
<patch name='dhcdbd-2.2-2.el5' />
<patch name='aex-inventory-7.0-6061' />
<patch name='krbafs-1.2.2-6' />
<patch name='perl-XML-Encoding-1.01-26' />
<patch name='pwlib-1.6.5-11' />
<patch name='kdemultimedia-3.3.1-2' />
<patch name='megaraid-v2.20.4.4-2dkms' />
<patch name='MQSeriesJava-6.0.1-0' />
<patch name='HelixPlayer-1.0.6-0.EL4.1' />
<patch name='gtk-engines-0.12-6.el4' />
<patch name='openmotif21-2.1.30-11.RHEL4.6' />
<patch name='IBM_db2icut81-8.1.3-136' />
<patch name='IBM_db2ca81-8.1.3-136' />
<patch name='pexp_x8664_c000-12.00.00.00-1' />
<patch name='cyrus-sasl-plain-2.1.22-4' />
<patch name='pam_passwdqc-1.0.2-1.2.2' />
<patch name='rdist-6.1.5-44' />
<patch name='pinfo-0.6.9-1.fc6' />
<patch name='libwnck-2.16.0-4.fc6' />
<patch name='libtermcap-devel-2.0.8-46.1' />
<patch name='indent-2.2.9-14.fc6' />
<patch name='webalizer-2.01_10-30.1' />
<patch name='sound-juicer-2.16.0-3.el5' />
<patch name='xorg-x11-drv-cirrus-1.1.0-2.fc6' />
<patch name='xorg-x11-drv-magictouch-1.0.0.5-2.1' />
<patch name='xorg-x11-drivers-7.1-4.1.el5' />
<patch name='gdk-pixbuf-0.22.0-25.el5' />
<patch name='bluez-hcidump-1.32-1' />
<patch name='perl-XML-Twig-3.26-1.fc6' />
<patch name='screen-4.0.3-1.el5' />
<patch name='kde-i18n-German-3.5.4-1' />
<patch name='termcap-5.5-1.20060701.1' />
<patch name='glibc-2.5-34' />
<patch name='readline-5.1-1.1' />
<patch name='nspr-4.7.3-2.el5' />
<patch name='binutils-2.17.50.0.6-9.el5' />
<patch name='iptables-1.3.5-4.el5' />
<patch name='mailx-8.1.1-44.2.2' />
<patch name='libvorbis-1.1.2-3.el5_1.2' />
<patch name='libusb-0.1.12-5.1' />
<patch name='libmng-1.0.9-5.1' />
<patch name='enscript-1.6.4-4.1.1.el5_2' />
<patch name='procmail-3.22-17.1' />
<patch name='libacl-2.2.39-3.el5' />
<patch name='aspell-0.60.3-7.1' />
<patch name='libXmu-1.0.2-5' />
<patch name='libXv-1.0.1-4.1' />
<patch name='libXevie-1.0.1-3.1' />
<patch name='libXxf86vm-1.0.1-3.1' />
<patch name='mesa-libGLU-6.5.1-7.7.el5' />
<patch name='tar-1.15.1-23.0.1.el5' />
<patch name='libXft-2.1.10-1.1' />
<patch name='python-elementtree-1.2.6-5' />
<patch name='device-mapper-event-1.02.28-2.el5' />
<patch name='pygobject2-2.12.1-5.el5' />
<patch name='hwdata-0.213.11-1.el5' />
<patch name='libXft-2.1.10-1.1' />
<patch name='passwd-0.73-1' />
<patch name='alsa-lib-1.0.17-1.el5' />
<patch name='libutempter-1.1.4-4.el5' />
<patch name='emacs-common-21.4-20.el5' />
<patch name='wpa_supplicant-0.5.10-8.el5' />
<patch name='cups-1.3.7-8.el5' />
<patch name='perl-DBI-1.52-2.el5' />
<patch name='libicu-3.6-5.11.1' />
<patch name='libacl-devel-2.2.39-3.el5' />
<patch name='apr-1.2.7-11' />
<patch name='squid-2.6.STABLE21-3.el5' />
<patch name='xml-common-0.6.3-18' />
<patch name='zenity-2.16.0-2.el5' />
<patch name='openssh-askpass-4.3p2-29.el5' />
<patch name='httpd-manual-2.2.3-22.el5' />
<patch name='dbus-glib-devel-0.73-8.el5' />
<patch name='vnc-server-4.1.2-14.el5' />
<patch name='libbonoboui-2.16.0-1.fc6' />
<patch name='gnome-utils-2.16.0-5.el5' />
<patch name='gnome-python2-2.16.0-1.fc6' />
<patch name='gnome-python2-applet-2.16.0-2.el5' />
<patch name='firstboot-1.4.27.7-1.el5' />
<patch name='dovecot-1.0.7-7.el5' />
<patch name='kdebase-3.5.4-19.el5' />
<patch name='isdn4k-utils-3.2-51.el5' />
<patch name='gimp-print-4.2.7-22.2.el5' />
<patch name='tcl-8.4.13-3.fc6' />
<patch name='aex-nsclt-7.0-8641' />
<patch name='system-config-mouse-1.2.9-1' />
<patch name='openjade-1.3.2-14' />
<patch name='imlib-1.9.13-23' />
<patch name='seamonkey-nspr-1.0.3-0.el4.1' />
<patch name='gaim-1.5.0-12.el4' />
<patch name='kdeaddons-3.3.1-2' />
<patch name='mysqlclient10-3.23.58-4.RHEL4.1' />
<patch name='ominstall-links-5.1.0-354' />
<patch name='bnx2-1.4.36b-5dkms' />
<patch name='IBM_db2icw81-8.1.3-136' />
<patch name='IBM_db2dc81-8.1.3-136' />
<patch name='tdicu-12.00.00.00-1' />
<patch name='cliv2_64-12.00.00.00-1' />
<patch name='libXfontcache-1.0.2-3.1' />
<patch name='nano-1.3.12-1.1' />
<patch name='gail-1.9.2-1.fc6' />
<patch name='readahead-1.3-7.el5' />
<patch name='boost-1.33.1-10.el5' />
<patch name='hesiod-devel-3.1.0-8' />
<patch name='ctags-5.6-1.1' />
<patch name='gnome-system-monitor-2.16.0-3.el5' />
<patch name='xorg-x11-drv-fpit-1.1.0-1.1' />
<patch name='xorg-x11-drv-aiptek-1.0.1-2' />
<patch name='xorg-x11-drv-calcomp-1.1.0-1.1' />
<patch name='compat-db-4.2.52-5.1' />
<patch name='compat-libstdc++-33-3.2.3-61' />
<patch name='statserial-1.1-38.2.2' />
<patch name='cyrus-sasl-md5-2.1.22-4' />
<patch name='zsh-4.2.6-1' />
<patch name='gnome-keyring-manager-2.16.0-3.el5' />
<patch name='xkeyboard-config-0.8-7.fc6' />
<patch name='popt-1.10.2.3-9.el5' />
<patch name='gawk-3.1.5-14.el5' />
<patch name='libjpeg-6b-37' />
<patch name='popt-1.10.2.3-9.el5' />
<patch name='ed-0.2-39.el5_2' />
<patch name='libfontenc-1.0.2-2.2.el5' />
<patch name='libvolume_id-095-14.19.el5' />
<patch name='libdrm-2.0.2-1.1' />
<patch name='aspell-0.60.3-7.1' />
<patch name='libiec61883-1.0.0-11.fc6' />
<patch name='cdrecord-2.01-10.7.el5' />
<patch name='libFS-1.0.0-3.1' />
<patch name='tcp_wrappers-7.6-40.6.el5' />
<patch name='libXext-1.0.1-2.1' />
<patch name='redhat-logos-4.9.16-1' />
<patch name='xorg-x11-xkb-utils-1.0.2-2.1' />
<patch name='libXfixes-4.0.1-2.1' />
<patch name='coreutils-5.97-19.el5' />
<patch name='newt-0.52.2-12.el5' />
<patch name='libgssapi-0.10-2' />
<patch name='MAKEDEV-3.23-1.2' />
<patch name='lockdev-1.0.1-10' />
<patch name='python-numeric-23.7-2.2.2' />
<patch name='fontconfig-2.4.1-7.el5' />
<patch name='libpcap-0.9.4-14.el5' />
<patch name='portmap-4.0-65.2.2.1' />
<patch name='dnsmasq-2.45-1.el5_2.1' />
<patch name='openssh-server-4.3p2-29.el5' />
<patch name='kernel-2.6.18-128.el5' />
<patch name='libnotify-0.4.2-6.el5' />
<patch name='redhat-lsb-3.1-12.3.EL' />
<patch name='libgomp-4.3.2-7.el5' />
<patch name='glibc-headers-2.5-34' />
<patch name='keyutils-libs-devel-1.2-1.el5' />
<patch name='gcc-gfortran-4.1.2-44.el5' />
<patch name='perl-DBD-MySQL-3.0007-2.el5' />
<patch name='gnome-doc-utils-0.8.0-2.fc6' />
<patch name='pygtk2-libglade-2.10.1-12.el5' />
<patch name='samba-3.0.33-3.7.el5' />
<patch name='system-config-language-1.1.18-2.el5' />
<patch name='bind-chroot-9.3.4-10.P1.el5' />
<patch name='xorg-x11-fonts-base-7.1-2.1.el5' />
<patch name='libbonoboui-2.16.0-1.fc6' />
<patch name='gthumb-2.7.8-8.el5' />
<patch name='nautilus-2.16.2-7.el5' />
<patch name='system-config-network-1.3.99.12-1.el5' />
<patch name='xorg-x11-drv-mutouch-1.1.0-3' />
<patch name='libobjc-4.1.2-44.el5' />
<patch name='rpm-build-4.4.2.3-9.el5' />
<patch name='pyparted-1.8.1-4.el5' />
<patch name='scim-anthy-1.2.0-6.el5' />
<patch name='aex-serverinventory-7.0-6022' />
<patch name='Omni-0.9.1-7.1' />
<patch name='Omni-foomatic-0.9.1-7.1' />
<patch name='pilot-link-0.11.8-8' />
<patch name='gnomemeeting-1.0.2-8' />
<patch name='w3c-libwww-5.4.0-10' />
<patch name='kdepim-3.3.1-2.1' />
<patch name='kdegraphics-3.3.1-3.9' />
<patch name='ipv6-1.1-1dkms' />
<patch name='xorg-x11-rhel4_radeon_dell_server-6.8.1-23.DELL.6.EL' />
<patch name='IBMJava2-AMD64-142-SDK-1.4.2-0.0' />
<patch name='elfutils-0.97.1-3' />
<patch name='openssl096b-0.9.6b-22.42' />
<patch name='IBM_db2secl81-8.1.3-136' />
<patch name='IBM_db2adts81-8.1.3-136' />
<patch name='IBM_db2xml81-8.1.3-136' />
<patch name='TeraGSS_redhatlinux-i386-06.02.00.00-1' />
<patch name='npaxsmod-01.05.00.00-1' />
<patch name='plod_x8664_c000-12.00.00.00-1' />
<patch name='fastexp-12.00.00.00-1' />
<patch name='rmt-0.4b41-2.fc6' />
<patch name='libXevie-1.0.1-3.1' />
<patch name='cdparanoia-alpha9.8-27.2' />
<patch name='fbset-2.1-22' />
<patch name='jwhois-3.2.3-8.el5' />
<patch name='libgtop2-2.14.4-3.el5' />
<patch name='netpbm-10.35-6.fc6' />
<patch name='dos2unix-3.1-27.1' />
<patch name='finger-0.17-32.2.1.1' />
<patch name='cyrus-sasl-2.1.22-4' />
<patch name='boost-1.33.1-10.el5' />
<patch name='libXvMC-1.0.2-2.1' />
<patch name='patchutils-0.2.31-2.2.2' />
<patch name='cscope-15.5-15.fc6.1' />
<patch name='libdbi-0.8.1-2.1' />
<patch name='system-config-rootpassword-1.1.9.1-1' />
<patch name='sendmail-cf-8.13.8-2.el5' />
<patch name='valgrind-3.2.1-6.el5' />
<patch name='libtool-1.5.22-6.1' />
<patch name='gnome-netstatus-2.12.0-5.el5' />
<patch name='eog-2.16.0.1-6.el5' />
<patch name='orca-1.0.0-5.el5' />
<patch name='file-roller-2.16.0-2.fc6' />
<patch name='xorg-x11-drv-penmount-1.1.0-2.1' />
<patch name='xorg-x11-drv-elographics-1.1.0-1.1' />
<patch name='xorg-x11-drv-joystick-1.1.0-1.1' />
<patch name='xorg-x11-drv-hyperpen-1.1.0-2' />
<patch name='gtk+-1.2.10-56.el5' />
<patch name='compat-gcc-34-g77-3.4.6-4' />
<patch name='aspell-de-0.50-11.2.2' />
<patch name='anthy-7900-4.el5' />
<patch name='man-pages-de-0.4-11' />
<patch name='xmlsec1-openssl-1.2.9-8.1' />
<patch name='gtkspell-2.0.11-2.1' />
<patch name='kdeutils-3.5.4-5.fc6' />
<patch name='perl-XML-Parser-2.34-6.1.2.2.1' />
<patch name='perl-XML-LibXML-1.58-5' />
<patch name='xchat-2.6.6-8.el5' />
<patch name='cyrus-sasl-md5-2.1.22-4' />
<patch name='unixODBC-kde-2.2.11-7.1' />
<patch name='nash-5.1.19.6-44' />
<patch name='emacs-leim-21.4-20.el5' />
<patch name='zlib-1.2.3-3' />
<patch name='bzip2-libs-1.0.3-4.el5_2' />
<patch name='ncurses-5.5-24.20060715' />
<patch name='libpng-1.2.10-7.1.el5_0.1' />
<patch name='libxml2-2.6.26-2.1.2.7' />
<patch name='tcp_wrappers-7.6-40.6.el5' />
<patch name='libpng-1.2.10-7.1.el5_0.1' />
<patch name='db4-4.3.29-9.fc6' />
<patch name='libvolume_id-095-14.19.el5' />
<patch name='patch-2.5.4-29.2.3.el5' />
<patch name='gzip-1.3.5-10.el5' />
<patch name='libICE-1.0.1-2.1' />
<patch name='slang-2.0.6-4.el5' />
<patch name='iputils-20020927-45.el5' />
<patch name='libXdmcp-1.0.1-2.1' />
<patch name='libIDL-0.8.7-1.fc6' />
<patch name='keyutils-libs-1.2-1.el5' />
<patch name='speex-1.0.5-4.el5_1.1' />
<patch name='mkisofs-2.01-10.7.el5' />
<patch name='acl-2.2.39-3.el5' />
<patch name='ttmkfdir-3.0.9-23.el5' />
<patch name='cdrdao-1.2.1-2' />
<patch name='libart_lgpl-2.3.17-4' />
<patch name='flac-1.1.2-28.el5_0.1' />
<patch name='audiofile-0.2.6-5' />
<patch name='gamin-0.1.7-8.el5' />
<patch name='redhat-menus-6.7.8-3.el5' />
<patch name='libXrandr-1.1.1-3.1' />
<patch name='libXxf86misc-1.0.1-3.1' />
<patch name='libXres-1.0.1-3.1' />
<patch name='perl-HTML-Parser-3.55-1.fc6' />
<patch name='xorg-x11-font-utils-7.1-2' />
<patch name='libXrandr-1.1.1-3.1' />
<patch name='libXpm-3.5.5-3' />
<patch name='cryptsetup-luks-1.0.3-4.el5' />
<patch name='e2fsprogs-libs-1.39-20.el5' />
<patch name='cairo-1.2.4-5.el5' />
<patch name='mesa-libGL-6.5.1-7.7.el5' />
<patch name='libuser-0.54.7-2.el5.5' />
<patch name='bind-libs-9.3.4-10.P1.el5' />
<patch name='yum-metadata-parser-1.1.2-2.el5' />
<patch name='qt-3.3.6-23.el5' />
<patch name='cryptsetup-luks-1.0.3-4.el5' />
<patch name='gphoto2-2.2.0-3.el5' />
<patch name='autofs-5.0.1-0.rc2.102' />
<patch name='fetchmail-6.3.6-1.1.el5' />
<patch name='Xaw3d-1.5E-10.1' />
<patch name='python-urlgrabber-3.1.0-5.el5' />
<patch name='cairo-1.2.4-5.el5' />
<patch name='GConf2-2.14.0-9.el5' />
<patch name='SysVinit-2.86-15.el5' />
<patch name='kbd-1.12-21.el5' />
<patch name='GConf2-2.14.0-9.el5' />
<patch name='samba-common-3.0.33-3.7.el5' />
<patch name='nss_ldap-253-17.el5' />
<patch name='mkinitrd-5.1.19.6-44' />
<patch name='prelink-0.4.0-2.el5' />
<patch name='rpm-libs-4.4.2.3-9.el5' />
<patch name='dbus-libs-1.1.2-12.el5' />
<patch name='dbus-1.1.2-12.el5' />
<patch name='avahi-0.6.16-1.el5' />
<patch name='NetworkManager-glib-0.7.0-3.el5' />
<patch name='kudzu-devel-1.2.57.1.21-1' />
<patch name='perl-BSD-Resource-1.28-1.fc6.1' />
<patch name='diffstat-1.41-1.2.3.el5' />
<patch name='slang-devel-2.0.6-4.el5' />
<patch name='libogg-devel-1.1.3-3.el5' />
<patch name='nss-devel-3.12.2.0-2.el5' />
<patch name='jpackage-utils-1.7.3-1jpp.2.el5' />
<patch name='elfutils-libelf-devel-0.137-3.el5' />
<patch name='mx-2.0.6-2.2.2' />
<patch name='xterm-215-8.el5' />
<patch name='kexec-tools-1.102pre-56.el5' />
<patch name='openjade-1.3.2-27' />
<patch name='libglade2-2.6.0-2' />
<patch name='postgresql-libs-8.1.11-1.el5_1.1' />
<patch name='php-cli-5.1.6-23.el5' />
<patch name='mysql-5.0.45-7.el5' />
<patch name='arts-1.5.4-1' />
<patch name='system-config-samba-1.2.41-3.el5' />
<patch name='bind-9.3.4-10.P1.el5' />
<patch name='avahi-glib-0.6.16-1.el5' />
<patch name='ghostscript-8.15.2-9.4.el5' />
<patch name='gnome-vfs2-2.16.2-4.el5' />
<patch name='libgnomeprint22-2.12.1-10.el5' />
<patch name='gnome-vfs2-2.16.2-4.el5' />
<patch name='gnome-panel-2.16.1-7.el5' />
</ospatches>

1 个答案:

答案 0 :(得分:3)

行ID与单元格分开保存。因此,如果idrow)中包含row.id属性,则无需添加id列。因此,您只需移除'id'中的colNames以及id中相应的colModel列。

此外,正如我在上一篇回答中所写的那样,addRowData的用法与jqGrid的data:filesystem参数的使用相比要慢得多。如果您尝试使用100或1000行进行此操作,您将看到差异非常明显。

您可以考虑对所有列使用sorttype:'int',以使列的排序正确。附加属性formatter:'integer'可以改善大数字的外观。

更新:我决定更准确地清除其他隐藏id列的使用与完全没有id列之间的差异。让我们拥有以下一行数据:

{id:5, total:10, free:20, used:30, percentage:40}

(值是否为“20”之类的字符串或20之类的数字并不重要。如果您在hidden:true列的定义中包含属性id,则网格中数据行将以简化形式显示为

<tr id="5"><td style="display:none">5</td><td>10</td><td>20</td><td>30</td><td>40</td></tr>

如果您只删除id列,则该行将显示为

<tr id="5"><td>10</td><td>20</td><td>30</td><td>40</td></tr>

jqGrid仅使用tr的id属性,并且从不使用其他隐藏id中的信息。所以,您只需从id中删除不需要的colModel列,就可以减少网格的内存使用量,并提高页面的性能。