jqgrid viewGridRow对话框大跨度和图标

我有一个带有一些数据的JQGRID,Id喜欢在用户双击该行时在对话框中显示行数据。 做到了:

ondblClickRow: function(rowid) { jQuery(this).jqGrid('viewGridRow', rowid); } 

但我有两个问题:

1:我在其中一个字段中有一个图标,当它在对话框中显示时,它的位置搞砸了(见下图)。

2:我在最后一个字段中有一个长文本(最多150个字符)。 该对话框以很长的跨度显示它,并创建一个水平滚动条。 我想让它以几行或类似textarea的方式显示文本,以便创建一个垂直滚动条。 已经尝试过这个:

 afterShowForm: function(form) { form.css("width", "fixed"); } 

但它没有用。

我正在考虑获得“editGridRow”的相同样式,但仅限于视图。 但它也没有成功。

任何人都知道如何解决这个问题?

**

编辑:

**

对不起伙计们,inheritance人我是如何填补网格的!

  $(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/YH:i', newformat:'d/m/YH: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 Vale Transporte", jsonReader: { repeatitems: false, root: "rows", total: "total", records: "records", id: "idsolicit_vale" }, ondblClickRow: function(rowid) { jQuery(this).jqGrid('viewGridRow', rowid); } }); jQuery("#gridJson").jqGrid('navGrid', '#pager', {edit:false,add:false,del:false}); }); 

见表:

  
NUM SOLICIT VALOR OBS STATUS DATA SOLICIT

图片: http : //i.stack.imgur.com/dphDB.jpg

**

编辑:

**

解决了这些问题,但在Internet Explorer 8中图标变得怪异了。这是图标的代码:

  

ICON in FIREFOX: 火狐 ICON IN IE8: IE8

视图表单将显示为HTML表格。 关于表格中文本的包装,你可以阅读这个和旧的答案。

如果是View表单,您可以使用以下CSS样式

 div.ui-jqdialog-content td.form-view-data { white-space: normal !important; height: auto; vertical-align: middle; padding-top: 3px; padding-bottom: 3px } 

在具有长数据的视图表单看起来像的情况下

在此处输入图像描述

如果检查相应的HTML代码,则在长文本的第一行中错误的左浮动的问题将会很明显。 你会看到  在每个单元格的开头都有数据。 空单元格包含HTML    。 我不确定这是否是一个错误  将被插入两次,但在包装文本的情况下,   不好。 例如,可以使用以下代码删除它:

 beforeShowForm: function ($form){ $form.find("td.DataTD").each(function () { var html = $(this).html(); //    if (html.substr(0, 6) === " ") { $(this).html(html.substr(6)); } }); } 

该演示显示,经过上述更改后,长文本将显示得足够好:

在此处输入图像描述

您不会发布从“状态”列填充图标的方式。 我希望,经过上述修改后,图标看起来会更好看。 如果您仍然有任何问题,可以检查相应单元格中的HTML代码(您可以在beforeShowForm的代码中包含alert(html) )并修改代码以便更好地显示。

你可以在这里找到我为答案写的演示。 您只需选择带有长文本的行来显示视图表单。

在这里找到关于“display:table”的答案Internet Explorer 8 bug with display:table 。 它奏效了!
我在页面的开头使用瞧!