Dash AgGrid Spanning on Partial value match

Hello. I’m trying to modify the java script from the “simple column spanning” example found here but instead of an exact match I want to look for characters contained in the string of that column. Below is the code I modified from the original example to try and make it work however the app never finishes updating. I also tried using .substring() instead of .includes() but that didn’t work either. Any thoughts or suggestions? When using the original example and keying in the entire string I am looking for it does in fact work so I do know that it is finding the js. Is there possibly a wildcard key that I could use in the lookup value instead of a built in function? Thanks in advance.

example of the full values that I am trying the partial lookup on are: “06/07 - 06/21” and “Week of 06/03”

Also is there a way to change the background color on only the spanned columns? In the example the color is applied to the entire column.

var dagfuncs = window.dashAgGridFunctions = window.dashAgGridFunctions || {};

dagfuncs.colSpanningSimple = function (params) {
    const responsible = params.data.Responsible;
    if (responsible.includes(' - ')) {
        return 4;
    } else if (responsible.includes('Week')) {
        return 4;
    } else {
        return 1;
    }
}

HI @Adam_G

That looks right to me. Do you have any errors in console?

Can you post an example that replicates the issue?

Hi @AnnMarieW ,

I am not getting any errors in the console. I was putting together a example to share but I can’t duplicate the problem in the example (the partial value match works in my example). I have to work on removing the proprietary data from my app so that I can share the problem but I don’t have time at the moment to do that.

Since I was trying to span 4 columns what I did instead was moved my data to the second column which almost puts it in the middle so visually I am accomplishing what I wanted.

I appreciate the response and I will repost once I find a solution or can share the failed code.