Row width and browser zoom

Row width and browser zoom

jmorrisonjmorrison Posts: 4Questions: 0Answers: 0
edited February 2013 in General
I had a post a little while back about row columns not filling 100% the width of the grid. I realized this problem was fixed when I restored my view from 90% to 100%. This may be something that should go in bugs but has anyone else had this problem or figured out a way around it? So long as my browser zoom is divisible by 100 there is no gap at the right end of my rows else there is.

Thanks,
JMorrison

Replies

  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    Might be a tricky one to solve that, if the browser is manipulating the width of elements. What browser are you using and how have you initialised DataTables?

    Allan
  • jmorrisonjmorrison Posts: 4Questions: 0Answers: 0
    Hi Allan and thank you for the response. I am currently developing/testing in google chrome (build 178923). Below is the code I use to instantiate the table.

    [code]
    var oTable;

    function CreateMessageTable(f) {
    oTable = $('#messageTable').dataTable({
    "bServerSide": true,
    "sAjaxSource": f,
    "bAutoWidth": false,
    "oLanguage": { "sEmptyTable": "No messages found" },
    "bProcessing": true,
    "bLengthChange": false,
    "bScrollInfinite": true,
    "oScroller": { "loadingIndicator": true },
    "bProcessing": true,
    "sScrollY": "275px",
    "fnDrawCallback": function (oSettings) {
    for (var i = 0, il = oSettings.aoData.length; i < il; i++) {
    if (oSettings.aoData[i]._aData[5] == "unread new") {
    oSettings.aoData[i].nTr.className = " message_unread";
    } else {
    oSettings.aoData[i].nTr.className = " message_read";
    }
    }
    },
    "fnInitComplete": function (oSettings) {
    for (var i = 0, il = oSettings.aoData.length; i < il; i++) {
    if (oSettings.aoData[i]._aData[5] == "unread new") {
    oSettings.aoData[i].nTr.className = " message_unread";
    } else {
    oSettings.aoData[i].nTr.className = " message_read";
    }
    }
    },
    "aoColumns": [
    { "sName": "Subject",
    "fnRender": function (oObj) {
    if (oObj.aData[5] == "True") {
    return "" + oObj.aData[0] + "";
    } else {
    return "" + oObj.aData[0] + "";
    }
    }
    },
    { "sName": "Message Type",
    "fnRender": function (oObj) {
    if (oObj.aData[5] == "True") {
    return "" + oObj.aData[1] + "";
    } else {
    return "" + oObj.aData[1] + "";
    }
    }
    },
    { "sName": "Date",
    "sType": "date",
    "fnRender": function (oObj) {
    if (oObj.aData[5] == "True") {
    return "" + oObj.aData[2] + "";
    } else {
    return "" + oObj.aData[2] + "";
    }
    }
    }

    ]
    });
    oTable.fnSort([[2, 'asc']]);
    }
    [/code]

    Thanks for the help!
  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    If Chrome doesn't support it, then yeah - probably going to be a really tricky one to solve. I will look into it though.

    Allan
  • adam12adam12 Posts: 8Questions: 3Answers: 0

    Hi guys,

    I'm experiencing this issue. It's fairly consistent across browsers, anyone come up with any solutions?

This discussion has been closed.