Datatable loop thru rows

Hi. I'm struggling with this one.
I'm have a datatable. I need to loop thru each row. Get the value of cell 1 and 2, depending on the value of the rest of the cells, i need to get the column header.
Example. Cell 1 and 2 in a row will be name and date, cell 3 to 18 will be values. If those values is anything other than ACD or blank i need to get the column heading for those cells.



  • DataFilter object works with any data available on the client-side and will render any valid string/HTML in header/footer content, so you can iterate through the data and do the needed checkup.

  • How to i set this to a specific datatable

  • Perhaps as an click event on a button

  • This will work in any datatable where


    is set in a column configuration.

    Apart from the datatable init, you can set new configuration of the column header:

    grida.getColumnConfig("title").header = [{content:"dynHeader"}];

    Please note that refreshColumns refreshes the entire datatable and may affect the performance.

  • Thank you,

  • edited October 2017

    Hi, Setup is as follows.
    Sidebar and multiview. One of the cells in the multiview is a datatable.

    So when i do this.

    {id:"FullName", header:[{content:"dynHeader"}],adjust:"data",cssFormat:mark_cells},
    {id:"ShiftDate",header: "Date",adjust:"data",cssFormat:mark_cells}

    The navigation function to that cell stops working. If i remove the dynHeader code and just give the header a name then the navigation works fine.


  • Hi,

    Unfortunately, I can't repeat the described behaviour.
    Can you please provide a sample where the issue can be seen?

  • Hi, i got it working for now thanks.

  • Is there another way of doing this, example datatable.EachRow

  • edited November 2017

    Can you please explain the requirements?

    datatable.eachRow iterates through the rows regarding the applied filtering/sorting, so some data can be lost. allows iterating through all data available on the client side with the 3rd parameter set to true:{
       console.log(" "+column);
       if (obj && obj[column] && obj[column] != "ACD"){
    }, master, true); 
  • Thank you. My Table setup is as follows. Columns: Full Name; Date; the rest of the columns headers is time starting at 00:00 ends 23:30 . 30 min incr.
    I need to loop thru each row, get the Full Name; Date; Value if not ACD or null and the column header for that value. So. it will look like this.
    Marco Zaaiman; 2017/11/13; Training; 08:00.
    I would like to share the code but it's very lengthy and have loads of dependents.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!