Tengo la siguiente configuracion

Tengo la siguiente configuracion

Aries1104Aries1104 Posts: 16Questions: 5Answers: 0

Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:

This question has an accepted answers - jump to answer

Answers

  • Aries1104Aries1104 Posts: 16Questions: 5Answers: 0

    searchPanes: {
    columns:[3,5,9,15,11,16],
    cascadePanes: true,
    viewTotal: true,
    layout: 'auto',
    controls: false,
    orderable: false,

    pero quiero que todo me lo acobode en un solo renglon si especifico
    layout: columns-6 si lo hace pero como no siempre tengo los mismos 6 paneles se crea mucha separacion

    por decir el panel de la columna 3 es ciudad y no siempre existen mas de una ciudad por lo cual no se crea el panel y eso afecta a la distribucion

    o alguna forma de saber cuantos paneles creo ?
    para yo poner algo como layout:columns-X

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    The default for the layout is auto, so it should lay them out evenly spread, as in here: http://live.datatables.net/zububadu/1/edit .

    Could you look at that, please, and see if it helps. If it's still not working for you, please can you update my example, or link to your page, so that we can see the problem.

    Cheers,

    Colin

  • Aries1104Aries1104 Posts: 16Questions: 5Answers: 0

    el problema es que requiero que solo sea un renglon y si uso layout: columns-6 cuando algun panel no es creado la distribucion no es proporcional
    existe una alguna forma de saber cuantos panel sean creado para asi usar use dato

    var NoColumnas = X;
    layout: NoColumnas

  • colincolin Posts: 15,112Questions: 1Answers: 2,583
    Answer ✓

    I see what you mean, but there's not an easy solution to know how many panels will be shown in advance. One fix though could be to always show the panels - http://live.datatables.net/zedujupa/1/edit - that way you know how many there will be.

    Colin

  • Aries1104Aries1104 Posts: 16Questions: 5Answers: 0

    si podria ser una buena opcion la que me envias
    mi solucion no tan elejante fue

    var divs = document.getElementsByClassName("dtsp-hidden").length;
    divs = 6-divs;

    switch(divs) {
    case 1:
    $("#tabla_wrapper > div.dtsp-panes.dtsp-panesContainer > div.dtsp-searchPanes > div.dtsp-columns-6 ").css('max-width','50%');
    break;
    case 2:
    $("#tabla_wrapper > div.dtsp-panes.dtsp-panesContainer > div.dtsp-searchPanes > div.dtsp-columns-6 ").css('max-width','50%');
    break;
    case 3:
    $("#tabla_wrapper > div.dtsp-panes.dtsp-panesContainer > div.dtsp-searchPanes > div.dtsp-columns-6 ").css('max-width','33%');
    break;
    case 4:
    $("#tabla_wrapper > div.dtsp-panes.dtsp-panesContainer > div.dtsp-searchPanes > div.dtsp-columns-6 ").css('max-width','24%');
    break;
    case 5:
    $("#tabla_wrapper > div.dtsp-panes.dtsp-panesContainer > div.dtsp-searchPanes > div.dtsp-columns-6 ").css('max-width','19%');
    break;
    default:
    break;
    }

Sign In or Register to comment.