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"
 });

Esse é meu código do subGrid, onde ele é aberto dentro de outra tabela.No IE a formatação dele sai toda desconfigurada ja no mozila se comporta perfeitamente. Alguem sabe me imformar se o subGrid ou o jqGrid tem alguma incompatibilidade com o IE?

1 Resposta 1

2

O firefox na verdade é mais tolerante com JSON mal formado. Um ponto interessante é verificar se o comprimento/tamanho de todos os hash's é igual ao que a tabela espera, mesmo o valor sendo null/nil, pois ao que me parece o Firefox formata certo mesmo não encontrando os valores. Pode ser ai que o IE está desconfigurando a sua tabela.

{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"}

Percebe que um hash tem mais chaves que o outro? Espero ter ajudado.

8
  • O JSON nao esta mal formado. O que você quiz dizer como tamanho dos hash's? 30/01/2014 às 17:06
  • Exemplo: O primeiro hash que eu colei ali tem 7 chaves, o segundo tem 8 chaves. O que pode estar dando problema no IE é o tamanho do número de colunas de sua tabela que não bate com o valor de chaves de todos os hash. Por isso ela fica desconfigurada no IE e perfeito no firefox. Entendeu? 30/01/2014 às 17:09
  • Então se eu retirar o ultimo atributo de cada linha (width e align) e deixar as linhas com o numero de atributos iguais, teria que funcionar? 30/01/2014 às 17:16
  • Mais um exemplo, agora prático, imagine a tabela da seguinte forma, preenchida com os dados que vão chegar via JSON: {id: "1", nome: "item 1", descricao: "teste 1", status: "ativo", valor: 10.00}, {id: "2", nome: "item 2", descricao: "teste 2",} |ID |Nome |Descrição |Status |Valor | |1 |Item 1 |teste 2 |ativo | 10.00 | |2 |Item 2 |teste 1 | | | Não tem dois valores no segundo item, isso pode ser o que esta causando o problema da tabela desconfigurada no IE. 30/01/2014 às 17:16
  • Exato, faça o teste, mande um JSON com todos os hash's com o mesmo tamanho. E veja se quebra no IE. 30/01/2014 às 17:17

Você deve fazer log-in para responder a esta pergunta.

Esta não é a resposta que você está procurando? Pesquise outras perguntas com a tag .