jQWidgets Forums

jQuery UI Widgets Forums Grid access other columns data in cellsrenderer function

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

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

  • badera
    Participant

    Dear all

    I have a jqxGrid with some columns and some cellsrenderer functions.

    Typically, I have some hidden columns with some extra infos, which I use in the cellsrenderer to generate the text (e.g. concat two datafields) / color / icon of my visible columns. Usually, I can use the ‘row’ index to access my records and access the hidden column:

    
        var myCellsRenderer = function (row, columnfield, value, defaulthtml, columnproperties) {
           return defaulthtml.replace(value, $scope.myrecords[row].firstName + " " + $scope.myrecords[row].lastName);
        }
    

    $scope.myrecords is saved in the ‘beforeLoadComplete’ callback of the dataAdapter of my grid.

    The problem with this approach is in virtual scrolling mode: Since the ‘row’ in the cellsrenderer seems to be the relative index (always 0 on top of grid) and the records returned in the beforeLoadComplete have the absolut index (e.g. on line 100000 of the grid, I have $scope.myrecords[100000] defined, and $scope.myrecords[0] is undefined), I do not know how to get the full row context.

    Does anybody know how to deal with that? Thanks in advance!
    – badera


    ivailo
    Participant

    Hi badera,

    You can try to use getrowboundindex method.

    Best Regards,
    Ivailo Ivanov

    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.