Created on 07-03-2015 10:33 AM - edited 07-03-2015 10:34 AM
I'm using Hue Search to build a dashboard.
Does anyone have an example of javascript being used to conditionally return a value?
For example, in my html tab I use something like {{value}} to refer to a var defined in an if/else statement in the CSS/JS tab.
Created 07-06-2015 02:19 AM
hi,
we use Mustache.js to render the items (or docs) returned from a search, so the variable you can reference from the editor are just the fields of the result doc and not JS variables you define.
We've seen something similar around where you define for instance a hidden column with the value you want to test and use jQuery to conditionally change what you want to change.
Created 07-06-2015 07:55 AM
Is there any way to add helper functions from the JS/css page ? Was trying to use the {{if value}} {{/if}} but that function does not seem to be available. Is there an easy way to add these functions ?
Created 07-06-2015 05:33 PM
Created 07-07-2015 06:45 AM
Thanks I have been googling and looking at the docs unfortunatly the IF and other functionality is not working. I am not sure if this is a shortcoming of the hue UI. Here is the exact code and not sudo code
We are using hue 3.8, it appears by looking at the source code that hue is referencing a mustache version 0.7.2 ( a little behind the current 2.1.2) so it might be that if helper is not supoorted ?
Because {{#if val}}{{val}}{{/if}} does not work.
I also tried doing the undefined or empty type function
this {{resultType}} is rendered to 'testType'
but this
{{#resultType}}{{resultType}}{{/resultType}} renders nothing, although according to the docs it should.
Any idea whats going on here ? Should we modfiy the templates directly instead of using hues UI ?
Created 07-29-2015 04:12 PM
Created 07-29-2015 10:16 PM
Created 07-29-2015 11:51 PM
Created 07-30-2015 08:29 AM