Formatting of subGrid in IE is not configured

Asked

Viewed 100 times

2

 var subgrid_table_id;
 subgrid_table_id = subgrid_id + "_t";
 jQuery("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='paginacaoSub'></div>");
 jQuery("#" + subgrid_table_id).jqGrid({
     url: urlRelatorioInterno,
     datatype: 'json',
     mtype: 'POST',
     colModel: [{
         name: "dataHora",
         index: "dataHora",
         jsonmap: "dataHora",
         label: "Data e Hora",
         sortable: true,
         sorttype: "dataHora",
         width: 80,
         key: true
     }, {
         name: "tipoSolicitacao",
         index: "tipoSolicitacao",
         jsonmap: "tipoSolicitacao",
         label: "Tipo Solicitacao",
         sortable: true,
         sorttype: "tipoSolicitacao",
         width: 130
     }, {
         name: "statusSolicitacao",
         index: "statusSolicitacao",
         jsonmap: "statusSolicitacao",
         label: "Status Solicitacao",
         sortable: true,
         sorttype: "statusSolicitacao",
         width: 80,
         align: "right"
     }, {
         name: "numeroSolicitacao",
         index: "numeroSolicitacao",
         jsonmap: "numeroSolicitacao",
         label: "Numero Solicitacao",
         sortable: true,
         sorttype: "numeroSolicitacao",
         width: 80,
         align: "right"
     }, {
         name: "numeroCartao",
         index: "numeroCartao",
         jsonmap: "numeroCartao",
         label: "Numero Cartao",
         sortable: true,
         sorttype: "numeroCartao",
         width: 100,
         align: "right",
         sortable: true
     }, {
         name: "nomeSegurado",
         index: "nomeSegurado",
         jsonmap: "nomeSegurado",
         label: "Nome Segurado",
         sortable: true,
         sorttype: "nomeSegurado",
         width: 80,
         align: "right"
     }, {
         name: "codigoReferenciado",
         index: "codigoReferenciado",
         jsonmap: "codigoReferenciado",
         label: "Codigo Referenciado",
         sortable: true,
         sorttype: "codigoReferenciado",
         width: 80,
         align: "right"
     }, {
         name: "nomeReferenciado",
         index: "nomeReferenciado",
         jsonmap: "nomeReferenciado",
         label: "Nome Referenciado",
         sortable: true,
         sorttype: "nomeReferenciado",
         width: 80,
         align: "right"
     }, {
         name: "senha",
         index: "senha",
         jsonmap: "senha",
         label: "Senha",
         sortable: true,
         sorttype: "senha",
         width: 80,
         align: "right"
     }, {
         name: "canalSolicitacao",
         index: "canalSolicitacao",
         jsonmap: "canalSolicitacao",
         label: "Canal Solicitacao",
         sortable: true,
         sorttype: "canalSolicitacao",
         width: 80,
         align: "right"
     }],
     pager: "#paginacaoSub",
     width: 'auto',
     height: 'auto',
     rowNum: 5,
     rowList: false,
     sortname: 'num',
     sortorder: "asc"
 });

This is my subGrid code, where it is opened inside another table.In IE the formatting of it comes out all disfigured already in mozila behaves perfectly. Can anyone tell me if subGrid or jqGrid has any incompatibility with IE?

1 answer

2


Firefox is actually more tolerant with poorly formed JSON. An interesting point is to check if the length/size of all hash’s is equal to what the table expects, even the value being null/nil, because it seems to me that Firefox format right even if not finding the values. This could be where IE is defacing his chart.

{name:"tipoSolicitacao",index:"tipoSolicitacao",jsonmap:"tipoSolicitacao",label:"Tipo Solicitacao", sortable: true, sorttype: "tipoSolicitacao" ,width:130}, 
{name:"statusSolicitacao",index:"statusSolicitacao",jsonmap:"statusSolicitacao",label:"Status Solicitacao", sortable: true, sorttype: "statusSolicitacao", width:80,align:"right"}

Do you realize one hash has more keys than the other? I hope I’ve helped.

  • JSON is not badly formed. What you mean by hash size?

  • Example: The first hash I pasted there has 7 keys, the second has 8 keys. What may be giving problem in IE is the size of the number of columns of your table that does not match the key value of all hash. That’s why it’s disfigured in IE and perfect in firefox. Got it?

  • So if I remove the last attribute from each line (width and align) and leave the lines with the number of equal attributes, it would have to work?

  • Another example, now practical, imagine the table as follows, filled with the data that will arrive via JSON: {id: "1", name: "item 1", description: "test 1", status: "active", value: 10.00}, {id: "2", name: "item 2", description: "test 2",} |ID |Name |Description |Status |Value | |1 |Item 1 |test 2 |active | 10.00 | |2 |Item 2 |test 1 | | | .

  • Exactly, do the test, send a JSON with all hash’s of the same size. And see if it breaks in IE.

  • I did exactly what you said Elvis Moreira and it didn’t work, the sub table remained deformed... Only in IE.

  • Elvis, which version of IE do you want to support? Are you sure you’re not in compatibility mode (so you’d be using the standards to IE7)?

  • I’m using version 9 of IE Vitor...in version 7 the design hardly runs. In theory it was not supposed to exist this imcompatibility in the version that I am giving support.

Show 3 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.