0

我正在使用footable 3 来显示一些通过ajax 获取的数据细节。其中一列是包含 HTML 内容的备忘录。当footable初始化工作正常但HTML备忘录自动转换为文本时。

这是表定义的示例

    $.ajax({
            url : "crm/ticket.data.php?o=bitacora",
            type : "POST",
            async: false,
            data: "id="+id, 
            dataType: 'json',
            success: function(resultado)
            {
                var html = '<table width="100%"  id="tbBitacora" class="table footable table-stripped table-hover toggle-circle" data-page-size="10" data-filtering="true" data-sorting="true" data-cascade="true">'
                +"<thead><tr>"
                    +"<th data-type='number' data-sortable='false' data-breakpoints='all'>Id</th>"
                    +'<th data-sortable="false" ><?=_('Emisión')?></th>' 
                    +"<th data-type='text' ><?=_('Asunto')?></th>"
                    +"<th data-type='text' ><?=_('Contacto')?></th>"
                    +"<th data-type='text' ><?=_('Requiriente')?></th>"
                    +"<th data-type='text' ><?=_('Compromiso')?></th>"
                    +"<th data-type='text' ><?=_('Estado')?></th>"
                    +"<th data-sortable='false' data-type='html' ><?=_('Memo')?></th>"
                +"</tr></thead>"
                +"<tbody>";
                $.each(resultado.data, function(i, item) 
                {
                    html += ''
                        +'<tr>'
                            +'<td>'+item.id+'</td>'
                            +'<td>'+moment(item.Fecha).format("DD/MM/YYYY HH:mm")+'</td>'
                            +'<td>'+item.asunto+'</td>'
                            +'<td>'+item.tipoContacto+'</td>'
                            +'<td>'+item.contacto+'</td>'
                            +'<td>'+moment(item.fCompromiso).format('DD/MM/YYYY HH:mm')+'</td>'
                            +'<td>'+item.estado+'</td>'
                            +'<td>'+item.memo+'</td>'
                        +'</tr>';
                });
                html += "</tbody><tfoot></tfoot></table>";
                $.dexModal( {
                    titulo:"<?=_("Bitácora del Ticket")?>", contenido:html, size:"lg" 
                } );
                setTimeout(1000);
                $('#tbBitacora').footable(  
                {
//                    breakpoints: {
//                        xs: 480, // extra small
//                        sm: 768, // small
//                        md: 992, // medium
//                        lg: 1200 // large
//                    },
                    filtering: {
                        placeholder: "<?=_("Buscar...")?>",
                        position: "left"
                    }
                });
                return false;
            }
        });

一个 Json 结果示例是:

{"sts":1,"msg":"Error de Violaci\u00f3n de Derechos de Seguridad","data":[{"id":"12560","Fecha":"2015-12-29 05:29:18","asunto":"nada","contacto":"Gonzalo Mier Araujo","tipoContacto":"Canales","usrCompromiso":"Martin Vartabedian","fCompromiso":"2015-12-30 05:29:18","memo":"<img src=\"upload\/2b44928ae11fb9384c4cf38708677c48.viejo\" style=\"width: 980px;\">\n                                    <div>La imagen celeste de Lite<\/div>","sector":" ","estado":"Ingresado en Proceso"},{"id":"12559","Fecha":"2015-12-29 05:24:40","asunto":"asdasdasdsadsadsad","contacto":"Gonzalo Mier Araujo","tipoContacto":"Canales","usrCompromiso":"Martin Vartabedian","fCompromiso":"2015-12-30 05:24:40","memo":"hola hola ","sector":" ","estado":"Ingresado en Proceso"},{"id":"12538","Fecha":"2015-12-01 16:35:54","asunto":"Descripcion e imagen del ERROR","contacto":"Gonzalo Mier Araujo","tipoContacto":"Canales","usrCompromiso":"Samanta Alonso","fCompromiso":"2015-12-02 16:35:54","memo":"<div>Todos los comprobantes con el punto de venta 1701, da ese error al generarlo (lo genera igual) y al consultarlo<\/div><div><br><\/div><div><br><\/div><div><br><\/div><div><br><\/div><img src=\"upload\/6c4b761a28b734fe93831e3fb400ce87.\" style=\"width: 720px;\">\n                                    ","sector":" ","estado":"Ingresado en Proceso"},{"id":"12539","Fecha":"2015-12-01 16:35:54","asunto":"Descripcion e imagen del ERROR","contacto":"Gonzalo Mier Araujo","tipoContacto":"Canales","usrCompromiso":"Samanta Alonso","fCompromiso":"2015-12-02 16:35:54","memo":"<div>Todos los comprobantes con el punto de venta 1701, da ese error al generarlo (lo genera igual) y al consultarlo<\/div><div><br><\/div><div><br><\/div><div><br><\/div><div><br><\/div><img src=\"upload\/6c4b761a28b734fe93831e3fb400ce87.\" style=\"width: 720px;\">\n                                    ","sector":" ","estado":"Ingresado en Proceso"},{"id":"12513","Fecha":"2015-12-01 12:32:37","asunto":"Armado de DOS SUCURSALES nuevas","contacto":"Gonzalo Mier Araujo","tipoContacto":"Canales","usrCompromiso":"Samanta Alonso","fCompromiso":"2015-12-02 12:32:37","memo":"Pide tener dos sucursales nuevas de CRISTAL","sector":" ","estado":"Ingresado en Proceso"}]}

感谢帮助!!

4

0 回答 0