Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #111662
    Oleg Ilin
    Participant

    Dear friend!

    I work with a virtual tree grid, where data is pulled from the server when the row is expanded. Is it possible to change the color of the row that is categories, that is, an expanding row. Yes, and besides, only one column is shown. In other words, the request contains three fields, one of which must be used to determine the color of the row, and the first shows the name of the category and, accordingly, when expanding the leaf your example,  https://www.htmlelements.com/demos/grid/virtual-tree-grid/

    For example, in your example, is it possible to change the colors of rows with the category expansion icon (do not forget that expanding a category entails a request to the server and receiving data for the expanding rows and the grid consists of one column)

    Thanks

    #111665
    Oleg Ilin
    Participant

    The issue is resolved. It turns out that by using the corresponding standart  function  cellsClassName() , which provides each line with its own ccs, the problem is solved very simply and allows you to build any hierarchical structures.

    ………………

    ……………..

    { label: “ORGANIZATION”, dataField: “NameOrg”,align:’left’,

    cellsClassName: (index, dataField, value, rowData, row) => {
    var level;
    var leaf’;
    level=row.data.level; //  level hierarchy Org
    leaf= row.data.leaf; // Customer

    if (leaf) { return ‘level-6’}  //css for customer
    if (level == 0) {
    return ‘level-0’; // up level
    };
    if (level == 1) {
    return ‘level-1’;
    };
    if (level == 2) {
    return ‘level-2’;
    };
    if (level == 3) {
    return ‘level-3’;
    };
    if (level == 4) {
    return ‘level-4’;
    };

    }, /// end cellsClass name

    • This reply was modified 3 weeks, 4 days ago by Oleg Ilin.
    • This reply was modified 3 weeks, 4 days ago by Oleg Ilin.
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.