在jqgrid中我们有很长的文本来自DB,但需要在JQgrid中显示时换行,有没有办法包装长文本(没有任何空格)?我们只有110px备用收款人姓名字段,因为我们需要显示多个列.我们的代码就像
{name:"firstPayeeName",index:"firstPayeeName", width:"110px", align:"left", sorttype:"string"},
Run Code Online (Sandbox Code Playgroud)
如果有的话,请提供解决方案.提前致谢.
我正在使用最新的jqgrid 4.3.1,我正在尝试使用冻结列.
问题是我在jqgrid中覆盖了默认的css来支持自动换行(在这个问题中可以看到css解决方案),我认为这就是冻结列与常规列没有正确对齐的原因.冻结行的高度与网格其余部分的高度不同.这是一个截图..冻结的列在红色框中突出显示(注意:我划掉了内容,因为它不是一个公共站点:
无论如何,在jqgrid中将冻结的列与单词包装的单元格对齐

注意:在尝试下面的Oleg解决方案后,它可以在Firefox中运行但在IE8中我没有看到水平滚动条(见图)

为了帮助回答Oleg的问题,这里是我的jqgrid设置的转储:
jQuery(gridSelector).jqGrid({
mtype: 'POST',
toppager: true,
url: siteRoot + controller + "/" + gridDataName + "?" + querystring,
datatype: "json",
colNames: names,
colModel: model,
shrinkToFit: false,
imgpath: siteRoot + "Scripts/jqGrid431/themes/steel/images",
rowNum: 20,
rowList: [10, 20, 50, 999],
altRows: true,
altclass: "altRow",
jsonReader: {
root: "Rows",
page: "Page",
total: "Total",
records: "Records",
repeatitems: false,
id: "Id"
},
search: true,
postData: (myfilter) ? { filters: JSON.stringify(myfilter)} : {},
//postData: { filters: …Run Code Online (Sandbox Code Playgroud) 如何在jqGrid上实现wordwrap,它适用于IE7,IE8和FF,同时还具有列调整大小的工作(网格正确对齐).
尝试使用特定宽度的div(基于初始TH宽度)对每个td进行内部包装内容,但colresize对我插入的div不起作用.jqGrid计算调整大小的TH和相邻TH的宽度.
有没有更好的解决方案可以避免所有的JavaScript'黑客'?
我试图扩展我的jQGrid以使标题有多行.
它看起来像这样
Run Code Online (Sandbox Code Playgroud)----------------------- Level 1 - > | Application | ----------------------- Level 2 - > |Code | Name | ----------------------- | 0002827| Mobile Phone1 | 0202827| Mobile Phone2 | 0042827| Mobile Phon3e | 0005827| Mobile Phone4 | 0002627| Mobile Phon5e | 0002877| Mobile Phone6 | 0002828| Mobile Phone7
我想知道如何用jQGrid 3.8.2做到这一点?有任何想法吗?
我有以下问题:我需要在Jqgrid上添加两行或更多行标题内容.我看到了Zac在jqgrid双标题下提供的示例,但是通过仅更改css我没有对网格进行任何更改.是否有可能有一个更完整的例子来重现行为?谢谢Angelo
我在我的页面中使用jqGrid,我修改了ui.jqgrid.css文件以包装列标题,如下所示:
.ui-jqgrid tr.jqgrow td {
white-space: normal !important;
}
.ui-th-column,.ui-jqgrid .ui-jqgrid-htable th.ui-th-column{
white-space:normal;
}
Run Code Online (Sandbox Code Playgroud)
它适用于所有浏览器,但IE!我试过IE7和IE8,问题依然存在.
我有一个带有一些数据的JQGRID,Id喜欢在用户双击该行时在对话框中显示行数据.这样做:
ondblClickRow: function(rowid) {
jQuery(this).jqGrid('viewGridRow', rowid);
}
Run Code Online (Sandbox Code Playgroud)
但我有两个问题:
1:我在其中一个字段中有一个图标,当它在对话框中显示时,它的位置搞砸了(见下图).
2:我在最后一个字段中有一个长文本(最多150个字符).该对话框以很长的跨度显示它,并创建一个水平滚动条.我想让它以几行或类似textarea的方式显示文本,以便创建一个垂直滚动条.已经尝试过这个:
afterShowForm: function(form) { form.css("width", "fixed"); }
Run Code Online (Sandbox Code Playgroud)
但它没有用.
我正在考虑获得"editGridRow"的相同样式,但仅限于查看.但它也没有成功.
任何人都知道如何解决这个问题?
**
**
对不起伙计们,继承人我是如何填补网格的!
<script type="text/javascript">
$(function() {
jQuery("#gridJson").jqGrid({
url:'Consulta_Dados_Ultimos.asp',
datatype: "json",
colNames:['N°','Data','Valor','Obs','Status'],
colModel:[
{name:'num_solicit_vale', align:'center', sorttype:'int', width:80},
{name:'data_solicit_vale',index:'data_solicit_vale',width:95,align:'center',sorttype:'date',
formatter:'date',formatoptions: {srcformat:'d/m/Y H:i', newformat:'d/m/Y H:i'}},
{name:'valor',index:'valor',width:80, align:'left', formatter:'currencyFmatter'},
{name:'obs_solicit_vale', sortable:false, width:240},
{name:'status_solicit_vale',index:'status_solicit_vale',width:80, formatter:'iconFmatter'}
],
rowNum:10,
rowList: [10,20,30],
rownumbers:true,
pager: '#pager',
sortname: 'data_solicit_vale',
viewrecords: true,
sortorder: "desc",
loadonce: true,
gridview: true,
hidegrid: false,
height: 230,
autowidth: '100%',
shrinkToFit: false,
viewrecords: true,
caption:"Consulta Solicitacao …Run Code Online (Sandbox Code Playgroud) 我可以像jQuery EasyUI库一样在jqGrid中实现一个列组吗?
你可以通过jQuery EasyUI 演示网站找出我的意思,然后从左侧菜单中选择Datagrid然后选择Column Group.
谢谢你的帮助
我想像这样创建 jqGrid

我可以划分身体 jqGrid 我写了这段代码
var data = [[1, 45, "E123", "1/1/11", "Done", 100], [2, 46, "E124", "1/12/11", "Done", 100]];
$("#grid").jqGrid({
datatype: "local",
height: 250,
colNames: ["SNO", "OrderID", "Location", "Date", "Status", "Amount"],
colModel: [{
name: 'SNO',
index: 'SNO',
width: 60},
{
name: 'OrderID',
index: 'OrderID',
width: 90,
formatter:orderFmatter},
{
name: 'Location',
index: 'Location',
hidden: true},
{
name: 'Date',
index: 'Date',
width: 80,
formatter:dateStatusFmatter},
{
name: 'Status',
index: 'Status',
width: 80,
hidden: true},
{
name: 'Amount',
index: 'Amount',
width: 80}
], …Run Code Online (Sandbox Code Playgroud)