0

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?

ldz
  • 2,217
  • 16
  • 21
B.Schyns
  • 57
  • 4
  • If you were using jQuery or something like it, you might be needing `"... this[" + platNom + "] ... "` instead of `" ... this[platNom] ... "` – theGleep Sep 22 '17 at 19:42

1 Answers1

0

If I understand correctly you would like to use attribute variable to construct the query string. Then you can do this by simply reference platNom directly. The correct syntax should be:

var invitants = ds.Convives.query(platNom + " == 'oui'")
Xiang Liu
  • 393
  • 1
  • 7