jQWidgets Forums

jQuery UI Widgets Forums Grid setcolumnproperty not working

Tagged: 

This topic contains 3 replies, has 2 voices, and was last updated by  maurizio 11 years, 11 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • setcolumnproperty not working #23250

    maurizio
    Participant

    I am trying to use the stecolumnproperty function to change the appearance of a column after the grid is rendered but it does not seem to work. Code as below (I am using version 2.8.3):

    am trying to use the stecolumnproperty function to change the appearance of a column after the grid is rendered but it does not seem to work. Code as below (I am using version 2.8.3):

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <title id='Description'>This example shows how to use the Grid API to customize a column's rendering.</title>
    <link rel="stylesheet" href="../jqwidgets/jqwidgets/styles/jqx.base.css" type="text/css" />
    <script type="text/javascript" src="../jqwidgets/scripts/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="../jqwidgets/jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="../jqwidgets/jqwidgets/jqxdata.js"></script>
    <script type="text/javascript" src="../jqwidgets/jqwidgets/jqxbuttons.js"></script>
    <script type="text/javascript" src="../jqwidgets/jqwidgets/jqxscrollbar.js"></script>
    <script type="text/javascript" src="../jqwidgets/jqwidgets/jqxlistbox.js"></script>
    <script type="text/javascript" src="../jqwidgets/jqwidgets/jqxdropdownlist.js"></script>
    <script type="text/javascript" src="../jqwidgets/jqwidgets/jqxmenu.js"></script>
    <script type="text/javascript" src="../jqwidgets/jqwidgets/jqxgrid.js"></script>
    <script type="text/javascript" src="../jqwidgets/jqwidgets/jqxgrid.pager.js"></script>
    <script type="text/javascript" src="../jqwidgets/jqwidgets/jqxgrid.selection.js"></script>
    <script type="text/javascript" src="../jqwidgets/scripts/gettheme.js"></script>
    <script type="text/javascript">
    $(document).ready(function () {
    var theme = getDemoTheme();
    var movies = new Array();
    // Avatar
    movies[0] = { Image: 'avatar.png', Title: 'Avatar', Year: 2009 };
    movies[1] = { Image: 'priest.png', Title: 'Priest', Year: 2006 };
    movies[2] = { Image: 'endgame.png', Title: 'End Game', Year: 2006 };
    movies[3] = { Image: 'unknown.png', Title: 'Unknown', Year: 2011 };
    movies[4] = { Image: 'unstoppable.png', Title: 'Unstoppable', Year: 2010 };
    movies[5] = { Image: 'twilight.png', Title: 'Twilight', Year: 2008 };
    movies[6] = { Image: 'kungfupanda.png', Title: 'Kung Fu Panda', Year: 2008 };
    movies[7] = { Image: 'knockout.png', Title: 'Knockout', Year: 2011 };
    movies[8] = { Image: 'theplane.png', Title: 'The Plane', Year: 2010 };
    movies[9] = { Image: 'bigdaddy.png', Title: 'Big Daddy', Year: 1999 };
    var imagerenderer = function (row, datafield, value) {
    return '<img style="margin-left: 5px;" height="60" width="50" src="../jqwidgets/images/' + value + '"/>';
    }
    var source = { localdata: movies, datatype: "array" };
    var dataAdapter = new $.jqx.dataAdapter(source);
    // Create jqxGrid.
    $("#jqxgrid").jqxGrid(
    {
    width: 400,
    source: dataAdapter,
    theme: theme,
    rowsheight: 60,
    columns: [
    { text: 'Image', datafield: 'Image', width: 60, cellsrenderer: imagerenderer },
    { text: 'Title', datafield: 'Title', width: 200 },
    { text: 'Year', datafield: 'Year' }
    ]
    });
    $('#jqxGrid').jqxGrid('setcolumnproperty', 'Title', 'width', 500);
    });
    </script>
    </head>
    <body class='default'>
    <div id='jqxWidget' style="font-size: 13px; font-family: Verdana; float: left;">
    <div id="jqxgrid">
    </div>
    </div>
    </body>
    </html>
    setcolumnproperty not working #23253

    maurizio
    Participant

    please see original post

    setcolumnproperty not working #23258

    support
    Participant

    Hi Maurizio,

    Please take a look at the “id” of the jqxGrid. In your case the Grid’s “id” is “jqxgrid” and you try to call a property in “jqxGrid”.If you have any further questions please do not hesitate to contact us.

    Best Wishes,
    Mariya

    jQWidgets Team
    http://www.jqwidgets.com

    setcolumnproperty not working #23265

    maurizio
    Participant

    How silly of me…. It works now with the correct case
    Thanks
    Maurizio

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.