Saturday, February 20, 2010

New Functions Added to JS Client Side Calculations

>at()
>atc()
>occurs()
>occursi()
>len()
at() - case sensitive version of atc()
occursi() - case insensitive version of occurs()

How to Post HTML in Blogger without the Browser Rendering the Code

Use this utility from BlogCrowds.com which will escape all the HTML chars:

http://www.blogcrowds.com/resources/parse_html.php

Generating an email link from Parent Data

Here's an example of using composing an email link pre-filled with data from the grid and placing the link into a div located somewhere on the page.

addr = "<a href='mailto:"+parent.v_email+"'>"+parent.v_email+"</a>";
$('d1').innerHTML='<b>Activity for '+addr+'</b>';

Selwyn on Passing JS Variable from Parent to Child


Parent JavaScript OnClick Event

window['v_email'] = {grid.object}.....
window['v_mobilephone'] = {grid.object}.....
window['v_city'] = {grid.object}......


Child onGridRender JavaScript System Event

var v_email2 = window['v_email'];
var v_mobilephone2 = window['v_mobilephone'];
var v_city2 = window['v_city'];

//confirm that you have received everything
alert(v_email2);
alert(v_mobilephone2);
alert(v_city2);

 And here's a Video of the technique: