Please, take a look at following code:
var platNom = "apero"; // I set the value of my attribute in one variable
var monAttribut = ds.Convives.attributes[platNom]; //this works
var invitants = ds.Convives.query("$(this[platNom] == 'oui') ", {allowJavascript: true});// This does not work
Is there a problem in my syntax?