Search for a span class

Search for a span class

karliekarlie Posts: 83Questions: 17Answers: 0

Hi, I have some text that is rendered when certain conditions are true, and it works as it should:

//Fifty Price if PAIR is selected
        if ( row['type'] == 'PAIR' &&row['pair_price'] !== null ) {return (data == null) ? "£" + (row['pair_price'] / ['100'] * ['50']).toFixed(2) : "£" + data;}
        
        //
        else  {return "<span class='missing-data'>Missing Data</span>" ;}

Is there anyway of searching for all the cells that contain the span class 'missing-data'? Obviously this data doesn't exist in the database, it is just displayed as and when certain conditions are true.

Answers

  • colincolin Posts: 15,144Questions: 1Answers: 2,586

    Hi @karlie ,

    This example demonstrates what to do. It shoehorns a span class into the cells where a user's name starts with 'A' - so the first two you'll see in the grid. The code at the bottom shows how to then search and access those cells.

    Hope that helps,

    Cheers,

    Colin

  • karliekarlie Posts: 83Questions: 17Answers: 0

    Hi Colin, thanks for your reply. I can't see how I can search that span class from your example though? I've managed to get the message 'Missing Data' to appear in my code, I just need some way of grouping all the 'Missing Data' rows together, so they can be dealt with. Or have I missed something from your example?

  • colincolin Posts: 15,144Questions: 1Answers: 2,586

    Hi @karlie ,

    Ah, I was responding to your point, "Is there anyway of searching for all the cells that contain the span class". The only way to group them would be to order on that column.

    Cheers,

    Colin

This discussion has been closed.