Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
150
Mark/Highlight/select row AND col on cell click
posted

Hi,

I'm using in a project the igGrid with a size of 350 rows and 350 columns at the moment.

Due to the size I want to give as an orientation indication for the user a row and column highlight (selection).

The idea is to click (select) a cell and afterwards the depending row and column should be highlighted/marked/selected. 

I tried to use an idea to work with fixed columns but due to the JSON that a get from the Web-Server I have to work with unbound columns.

I would appreciate tips

Parents
No Data
Reply
  • 1300
    Offline posted

    Hello Hazim,

    After investigating this further, I determined that the row of the clicked cell could be selected by enabling the Selection feature. Regarding highlighting the column of the selected cell, what I could suggest is binding a method to the cellClick event. In this method a css class is set to the column of the clicked cell by using the property columnCssClass and the class is removed from all other columns. In order to set the new styles of the columns the dataBind method of the grid should be called:

    cellClick: function (evt, ui) {

                        var cols = $("#grid").igGrid("option", "columns");

                        cols.forEach(col => {

                            col.columnCssClass = "";

                        })

                        var col = $("#grid").igGrid("columnByKey", ui.colKey);

                        col.columnCssClass = "colStyle";

                        $("#grid").igGrid("dataBind");

                    }

    Below I am attaching a sample, demonstrating the described behavior. Please test it on your side and let me know if you need any further information regarding this matter.

    Regards,
    Monika Kirkova,
    Infragistics

    igGridSelectRowAndColumn.zip

Children