The developer console in your browser is your friend here Loic (I use chrome) and I reckon it'd report a missing token. The second render view event needs closing with another bracket and semi-colon I think like this:
$(document).on('knack-view-render.view_955', function(event, view, data) if ($("#view_955-field_1536").val() != "0") { $(document).on('knack-view-render.view_957', function(event, view, data) { $("#view_957 > div > a > span:contains('Group')").parent().hide(); }); //<- here } });
Keep in mind I'm no expert by any stretch but Knack has helped me learn Javascript and CSS having moved apps over from MS Access (and VBA!).
Thank for your reply. So I have tried to add the conditional test but it crashes my app (I am not a developer at all so it is not surprising).
Here is my code
$(document).on('knack-view-render.view_955', function(event, view, data) if ($("#view_955-field_1536").val() != "0") { $(document).on('knack-view-render.view_957', function(event, view, data) { $("#view_957 > div > a > span:contains('Group')").parent().hide(); } } });
View 955 is a detail view containing the field used in the condition test. View 957 is the menu. I feel like the issue is that there is no 'else' but I have no idea how to write 'else do nothing'
Funny, I was just working on some code that included this - #view_841 is the menu view itself, and this hides the item with the text 'New Task'. The code sits inside conditional tests.
$("#view_841 > div > a > span:contains('New Task')").parent().hide();