FixedColumns only when there is horizontal scroll need?

FixedColumns only when there is horizontal scroll need?

marianopeckmarianopeck Posts: 53Questions: 8Answers: 0
edited October 2013 in General
Hi guys. I have a webapp in which I have many tables. Yet, the rendering engine is more or less the same for all of them. FixedColumns are great but they bring understandable overhead. So is there a way (some javascript magic lines) to create the FixedColumns only if I happen to need an horizontal scroll? Because otherwise, it doesn't make sense and I want to avoid adding extra overhead.

Thanks

Replies

  • marianopeckmarianopeck Posts: 53Questions: 8Answers: 0
    OK. Just in case someone is interested, I solved quite easily doing this:

    if ( oTable.width() > $(".tableContainer").width() ) {

    // add FixedColumns
    var oTable2 = new FixedColumns( oTable, {
    "iLeftColumns": 2,
    "iRightColumns": 1,
    "sHeightMatch": "auto"
    } );

    .....

    }
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Very nice - like it! Its tempting to put that into FixedColumns itself, but I'd be concerned that a reload of the data, or adding new data etc, might need scrolling after all, so I'll probably not put it in for the moment, but nice solution :-)

    Allan
  • marianopeckmarianopeck Posts: 53Questions: 8Answers: 0
    Ahhhh good point, because I was wondering exactly that...why it was not integrated in FixedColumns itself... In my case, my app is server-based, with nothing happening in the client...each request, the table is rendered again....so the mentioned case of adding new data etc wouldn't be a problem.
This discussion has been closed.