I have a JQGRID with some data and Id like to show the row data in a dialog when the users double clicks the row. Did that with:
ondblClickRow: function(rowid) {
jQuery(this).jqGrid('viewGridRow', rowid);
}
But I had 2 problems with that:
1: I have an icon in one of the fields and when it shows in the dialog, its position is messed up(see pic below).
2: I have a long text(150 char maximum) in the last field. The dialog is showing it in a long span and it creates an horizontal scroll bar. I wanted it to show the text in a couple of lines or something like a textarea so it creates a vertical scroll bar. Already tried this:
afterShowForm: function(form) { form.css("width", "fixed"); }
But it didnt work.
I was thinking about getting the same styling of "editGridRow" but something like view only. But it didnt work out too.
Anyone got any idea about how can I solve that?
**
EDIT:
**
Sorry guys, heres how I fill the Grid!
<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 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});
});
Heres the table:
<table id="gridJson"/>
<thead>
<tr align="center">
<th>NUM SOLICIT</th>
<th>VALOR</th>
<th>OBS</th>
<th>STATUS</th>
<th>DATA SOLICIT</th>
</tr>
</thead>
</table>
<div id="pager"></div>
IMAGE : https://i.sstatic.net/dphDB.jpg
**
EDIT:
**
Solved those issues but the icon is going weird in internet explorer 8. Here's the code of the icon:
<div class="ui-state-attention ui-corner-all" style="display:table">
<span class="ui-icon ui-icon-alert" title="Aguardando"></span>
</div>
ICON IN FIREFOX : ICON IN IE8:
like I showed in my answer. In my tests the icons looks very good after removing
. – Josuejosy