HTML5 Data Bindings Support Product Page

Answered

Hide a script if a recordset is > 1

Asked 29 Dec 2014 20:50:57
1
has this question
29 Dec 2014 20:50:57 Michele - posted:
Hello,
I need to hide a script in a page if the total of a recordset is > 1... is it possible with HTML5 Data Bindings?

For example:
<script data-binding-hide="{{connTest.data.where( &quot;connTest.total&quot;, &quot;&gt;&quot;, 1 )}}">
[script instruction]
</script>


Thanks

Replies

Replied 05 Jan 2015 11:03:10
05 Jan 2015 11:03:10 Teodor Kuduschiev replied:
Hello Michele,
I am not sure what exactly do you need to achieve? What do you mean to hide a script? Do you mean not to run it?
Replied 05 Jan 2015 11:54:02
05 Jan 2015 11:54:02 Michele - replied:
Hi Teodor... yes, I'd like to avoid the execution of the javascript (it's used in an app, built with PhoneGap) if the recordset is > 1
Replied 05 Jan 2015 15:52:37
05 Jan 2015 15:52:37 Teodor Kuduschiev replied:
You can do the following:
1. Define your javascript function / script.
2. Add the repeat region with your data on your page
3. Using the extended repeater OnAfterRender event call/run the javascript function.
The afterRender event will only be fired when the recordset is not empty.
Replied 06 Jan 2015 10:28:17
06 Jan 2015 10:28:17 Michele - replied:
great! thanks!!!

Reply to this topic