jQWidgets Forums

jQuery UI Widgets Forums Grid Little Gotcha with referencing of Columns?

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 11 years, 10 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • TMC
    Member

    During Document.Ready the grid’s columns property is an array. However, when called during page “run-time” it is not but is instead a property of columns named records… This leads to some interesting issues when calling a common function from both. So to fix, I added in a little shim function to get it as array no matter what – it is below for anyone whose having issues with this. Don’t know if its a bug or intentional (fix?):

    function getColumnsArray() {
    var bIsArray = $.isArray($(“#jqxgrid”).jqxGrid(‘columns’));

    if (bIsArray) {
    return $(“#jqxgrid”).jqxGrid(“columns”);
    } else{
    return $(“#jqxgrid”).jqxGrid(“columns”).records;
    }
    }


    Peter Stoev
    Keymaster

    Hi TMC,

    There is no “getter” for the columns property. You can only set it and that is intentional.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.